Library-owned schema migration (Oban-style).
The host application does not copy the DDL; it writes a one-line Ecto migration that delegates here:
defmodule MyApp.Repo.Migrations.SetupGenDurable do
use Ecto.Migration
def up, do: GenDurable.Migration.up()
def down, do: GenDurable.Migration.down()
endOptions
:prefix— Postgres schema the tables live in (default"public").:version— schema version to migrate to (default: latest forup/1,0fordown/1).
The installed schema version is recorded in COMMENT ON TABLE gen_durable,
so up/1 only applies the increments that are missing. This keeps the
host-facing call stable as the schema evolves across library releases.
Summary
Functions
Migrate the schema down to :version (default: 0, i.e. drop everything).
Migrate the schema up to :version (default: latest).