mix ecto_immigrant.rollback (ecto_immigrant v0.3.0)

Reverts applied data migrations for the given repository.

Data migrations are expected at "priv/YOUR_REPO/data_migrations" directory of the current application, where "YOUR_REPO" is the last segment in your repository name. For example, the repository MyApp.Repo will use "priv/repo/data_migrations". The repository Whatever.MyRepo will use "priv/my_repo/data_migrations".

This task rolls back the last applied data migrations by default.

If a repository has not yet been started, one will be started outside your application supervision tree and shutdown afterwards.

Examples

mix ecto_immigrant.rollback
mix ecto_immigrant.rollback -r Custom.Repo

mix ecto_immigrant.rollback -n 3
mix ecto_immigrant.rollback --step 3

mix ecto_immigrant.rollback --to 20080906120000

Command line options

  • -r, --repo - the repo to rollback

  • --all - revert all applied migrations

  • --step, -n - revert n number of applied migrations

  • --to - revert all migrations down to and including version

  • --quiet - do not log migration commands

  • --prefix - the prefix to run migrations on

  • --log-sql - log the raw sql migrations are running