Public migration API for mailglass.
Adopters consume this via a single 8-line wrapper file that
mix mailglass.gen.migration (Phase 7) emits:
defmodule MyApp.Repo.Migrations.AddMailglass do
use Ecto.Migration
def up, do: Mailglass.Migration.up()
def down, do: Mailglass.Migration.down()
endThe wrapper stays stable across mailglass versions; per-version DDL
lives in Mailglass.Migrations.Postgres.VNN modules, dispatched by
Mailglass.Migrations.Postgres tracking the current version in the
pg_class comment on mailglass_events.
Postgres-only at v0.1 per PROJECT.md (MySQL/SQLite out of scope).
Summary
Functions
Rolls back migrations down to the target version (default: 0).
Returns the currently-applied migration version (0 if none).
Runs all pending migrations up to the latest version.
Functions
@spec down(keyword()) :: :ok
Rolls back migrations down to the target version (default: 0).
@spec migrated_version(keyword()) :: non_neg_integer()
Returns the currently-applied migration version (0 if none).
This function is safe to call outside an Ecto.Migrator context —
unlike up/1 / down/1, it does not rely on the migration runner
process (it issues a single pg_catalog.obj_description query against
the configured Repo and returns an integer).
@spec up(keyword()) :: :ok
Runs all pending migrations up to the latest version.