Ecto.Adapter.Migrations 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}

Table subcommands

Callbacks

ddl_exists?/2

Specs:

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.

Source
execute_ddl/2

Specs:

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.

Source