Ecto.Adapter.Migration behaviour

Specifies the adapter migrations API.

Source

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}

Callbacks

ddl_exists?/3

Specs:

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
Source
execute_ddl/3

Specs:

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
Source
supports_ddl_transaction?/0

Specs:

  • supports_ddl_transaction? :: boolean

Checks if the adapter supports ddl transaction.

Source