Ecto.Adapter.Migration 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}
All commands allowed within the block passed to table/2
ddl_object :: Ecto.Migration.Table.t | Ecto.Migration.Index.t
A DDL object is a struct that represents a table or index in a database schema. These database objects can be modified through the use of a Data Definition Language, hence the name DDL object.
Callbacks
Specs:
- ddl_exists?(Ecto.Repo.t, ddl_object, Keyword.t) :: boolean
Checks if ddl value, like a table or index, exists.
Options
:timeout
- The time in milliseconds to wait for the call to finish,:infinity
will wait indefinitely (default: 5000);:log
- When false, does not log begin/commit/rollback queries
Specs:
- execute_ddl(Ecto.Repo.t, command, Keyword.t) :: :ok | no_return
Executes migration commands.
Options
:timeout
- The time in milliseconds to wait for the call to finish,:infinity
will wait indefinitely (default: 5000);:log
- When false, does not log begin/commit/rollback queries
Specs:
- supports_ddl_transaction? :: boolean
Checks if the adapter supports ddl transaction.