Mix.Tasks.Ecto.Gen.Migration

Mix.Tasks.Ecto.Gen.Migration

Generates a migration.

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

Examples

mix ecto.gen.migration add_posts_table
mix ecto.gen.migration add_posts_table -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

© 2012 Plataformatec
Licensed under the Apache License, Version 2.0.
https://hexdocs.pm/ecto/Mix.Tasks.Ecto.Gen.Migration.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部