Ecto.Adapter.Migrations behaviour

Specifies the adapter migrations API.

Source

Callbacks

migrate_down/3

Specs:

  • migrate_down(Ecto.Repo.t, integer, binary) :: :ok | :missing_up | no_return

Runs a down migration.

It expects a repository, the migration version and the migration code.

Examples

migrate_down(Repo, 20080906120000, "DROP TABLE users")

Source
migrate_up/3

Specs:

  • migrate_up(Ecto.Repo.t, integer, binary) :: :ok | :already_up | no_return

Runs an up migration.

It expects a repository, the migration version and the migration code.

Examples

migrate_up(Repo, 20080906120000, "CREATE TABLE users(id serial, name text)")

Source
migrated_versions/1

Specs:

  • migrated_versions(Ecto.Repo.t) :: [integer] | no_return

Returns all migrated versions as integers.

Source