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}

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

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