View Source mix exzeitable.gen.migration (Exzeitable v0.6.8)

Generates a migration file adding the pg_trgm extension to postgres.

The repository must be set under :ecto_repos in the current app configuration or given via the -r option.

Example

$ mix exzeitable.gen.migration
$ mix exzeitable.gen.migration -r Custom.Repo

By default, the migration will be generated to the "priv/YOUR_REPO/migrations" directory of the current application but it can be configured to be any subdirectory of priv by specifying the :priv key under the repository configuration.

This generator will automatically open the generated file if you have ECTO_EDITOR set in your environment variable.

Command line options

  • -r, --repo - the repo to generate migration for
  • --no-compile - does not compile applications before running
  • --no-deps-check - does not check dependencies before running
  • --migrations-path - the path to run the migrations from, defaults to priv/repo/migrations

Configuration

If the current app configuration specifies a custom migration module the generated migration code will use that rather than the default Ecto.Migration:

config :ecto_sql, migration_module: MyApplication.CustomMigrationModule