Ecto.Adapter.Migrations behaviour
Specifies the adapter migrations API.
Types ↑
command :: raw :: String.t | {:create, Ecto.Migration.Table.t, [table_subcommand]} | {:alter, Ecto.Migration.Table.t, [table_subcommand]} | {:drop, Ecto.Migration.Table.t} | {:create, Ecto.Migration.Index.t} | {:drop, Ecto.Migration.Index.t}
All migration commands
table_subcommand :: {:add, field :: atom, type :: Ecto.Type.t | Ecto.Migration.Reference.t, Keyword.t} | {:modify, field :: atom, type :: Ecto.Type.t | Ecto.Migration.Reference.t, Keyword.t} | {:remove, field :: atom}
Table subcommands
Callbacks
Specs:
- ddl_exists?(Ecto.Repo.t, Ecto.Migration.Table.t | Ecto.Migration.Index.t) :: boolean
Checks if ddl value, like a table or index, exists.
Note ddl queries should not be logged as they are logged automatically by the migrator.
Specs:
- execute_ddl(Ecto.Repo.t, command) :: :ok | no_return
Executes migration commands.
It is recommended for adapters to use timeout of infinity in such commands, as tasks like adding indexes and upgrading tables can take hours or even days. Also, ddl queries should not be logged as they are logged automatically by the migrator.