Runs Arcadic.Migrations in order and tracks applied versions in the
_arcadic_migrations document type. Tenant-blind: it runs DDL/DML and records
integer versions — no tenant, scope, or Ash concept. Assumes single-process,
deploy-time execution (like every migration tool); it does not take an advisory
lock, so do not run two migrators concurrently against one database.
Summary
Functions
Run all pending migrations (up). Returns {:ok, count_run}.
Registered migrations not yet applied, ascending by version (pure).
Roll back every applied migration, then migrate all. Returns {:ok, migrated_count}.
Roll back the last n applied migrations (down), newest first. Returns {:ok, count}.
Status of each registered migration: {version, :up | :down}, ascending.
Functions
@spec migrate(Arcadic.Conn.t(), module()) :: {:ok, non_neg_integer()} | {:error, Exception.t()}
Run all pending migrations (up). Returns {:ok, count_run}.
Registered migrations not yet applied, ascending by version (pure).
@spec reset(Arcadic.Conn.t(), module()) :: {:ok, non_neg_integer()} | {:error, Exception.t()}
Roll back every applied migration, then migrate all. Returns {:ok, migrated_count}.
@spec rollback(Arcadic.Conn.t(), module(), pos_integer()) :: {:ok, non_neg_integer()} | {:error, Exception.t()}
Roll back the last n applied migrations (down), newest first. Returns {:ok, count}.
@spec status(Arcadic.Conn.t(), module()) :: {:ok, [{pos_integer(), :up | :down}]} | {:error, Exception.t()}
Status of each registered migration: {version, :up | :down}, ascending.