Skip to content

Commit 243bd92

Browse files
committed
Order migrate flags
1 parent b67cdae commit 243bd92

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

lib/ecto/migrator.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ defmodule Ecto.Migrator do
209209
* `:dynamic_repo` - the name of the Repo supervisor process.
210210
See `c:Ecto.Repo.put_dynamic_repo/1`.
211211
* `:strict_version_order` - abort when applying a migration with old timestamp
212+
(otherwise it emits a warning)
212213
"""
213214
@spec up(Ecto.Repo.t, integer, module, Keyword.t) :: :ok | :already_up
214215
def up(repo, version, module, opts \\ []) do

lib/mix/tasks/ecto.migrate.ex

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -68,35 +68,35 @@ defmodule Mix.Tasks.Ecto.Migrate do
6868
6969
## Command line options
7070
71-
* `-r`, `--repo` - the repo to migrate
72-
7371
* `--all` - run all pending migrations
7472
75-
* `--step`, `-n` - run n number of pending migrations
73+
* `--log-sql` - log the underlying sql statements for migrations
7674
77-
* `--to` - run all migrations up to and including version
75+
* `--migrations-path` - the path to load the migrations from, defaults to
76+
`"priv/repo/migrations"`. This option may be given multiple times in which
77+
case the migrations are loaded from all the given directories and sorted
78+
as if they were in the same one
7879
79-
* `--quiet` - do not log migration commands
80+
* `--no-compile` - does not compile applications before migrating
8081
81-
* `--prefix` - the prefix to run migrations on
82+
* `--no-deps-check` - does not check dependencies before migrating
8283
83-
* `--pool-size` - the pool size if the repository is started only for the task (defaults to 2)
84+
* `--pool-size` - the pool size if the repository is started
85+
only for the task (defaults to 2)
8486
85-
* `--log-sql` - log the raw sql migrations are running
87+
* `--prefix` - the prefix to run migrations on
8688
87-
* `--strict-version-order` - abort when applying a migration with old timestamp
89+
* `--quiet` - do not log migration commands
8890
89-
* `--no-compile` - does not compile applications before migrating
91+
* `-r`, `--repo` - the repo to migrate
9092
91-
* `--no-deps-check` - does not check dependencies before migrating
93+
* `--step`, `-n` - run n number of pending migrations
9294
93-
* `--migrations-path` - the path to load the migrations from, defaults to
94-
`"priv/repo/migrations"`. This option may be given multiple times in which case the migrations
95-
are loaded from all the given directories and sorted as if they were in the same one.
95+
* `--strict-version-order` - abort when applying a migration with old
96+
timestamp (otherwise it emits a warning)
97+
98+
* `--to` - run all migrations up to and including version
9699
97-
Note, if you have migrations paths e.g. `a/` and `b/`, and run
98-
`mix ecto.migrate --migrations-path a/`, the latest migrations from `a/` will be run (even
99-
if `b/` contains the overall latest migrations.)
100100
"""
101101

102102
@impl true

lib/mix/tasks/ecto.rollback.ex

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,35 @@ defmodule Mix.Tasks.Ecto.Rollback do
6464
6565
## Command line options
6666
67-
* `-r`, `--repo` - the repo to rollback
67+
* `--all` - run all pending migrations
6868
69-
* `--all` - revert all applied migrations
69+
* `--log-sql` - log the underlying sql statements for migrations
7070
71-
* `--step`, `-n` - revert n number of applied migrations
71+
* `--migrations-path` - the path to load the migrations from, defaults to
72+
`"priv/repo/migrations"`. This option may be given multiple times in which
73+
case the migrations are loaded from all the given directories and sorted
74+
as if they were in the same one
7275
73-
* `--to` - revert all migrations down to and including version
76+
* `--no-compile` - does not compile applications before migrating
7477
75-
* `--quiet` - do not log migration commands
78+
* `--no-deps-check` - does not check dependencies before migrating
79+
80+
* `--pool-size` - the pool size if the repository is started
81+
only for the task (defaults to 2)
7682
7783
* `--prefix` - the prefix to run migrations on
7884
79-
* `--pool-size` - the pool size if the repository is started only for the task (defaults to 2)
85+
* `--quiet` - do not log migration commands
8086
81-
* `--log-sql` - log the raw sql migrations are running
87+
* `-r`, `--repo` - the repo to migrate
8288
83-
* `--no-compile` - does not compile applications before rolling back
89+
* `--step`, `-n` - revert n migrations
8490
85-
* `--no-deps-check` - does not check dependencies before rolling back
91+
* `--strict-version-order` - abort when applying a migration with old
92+
timestamp (otherwise it emits a warning)
8693
87-
* `--migrations-path` - the path to load the migrations from, defaults to
88-
`"priv/repo/migrations"`. This option may be given multiple times in which case the migrations
89-
are loaded from all the given directories and sorted as if they were all in the same one.
94+
* `--to` - revert all migrations down to and including version
9095
91-
Note, if you have migrations paths e.g. `a/` and `b/`, and run
92-
`mix ecto.rollback --migrations-path a/`, only the latest migrations from `a/` will be
93-
rolled back (even if `b/` contains the overall latest migrations.)
9496
"""
9597

9698
@impl true

0 commit comments

Comments
 (0)