kura_migrator (kura v2.0.6)
View SourceRuns, rolls back, and reports status of migrations.
Discovers migration modules automatically from the application that owns the
repo module. Any module named m<YYYYMMDDHHMMSS>_<name> in the application's
module list is treated as a migration. Tracks applied versions in a
schema_migrations table.
All migrations run within a single transaction protected by a PostgreSQL
advisory lock (pg_advisory_xact_lock) to prevent concurrent execution
across multiple nodes.
Summary
Functions
Check migration operations for actions that are unsafe during rolling deployments.
Compile a single DDL operation to SQL using RepoMod's dialect.
Run all pending migrations in order.
Roll back the last migration.
Roll back the last Steps migrations.
Return the status of all discovered migrations (:up or :pending).
Functions
-spec check_unsafe_operations([kura_migration:operation()], [kura_migration:safe_entry()]) -> [map()].
Check migration operations for actions that are unsafe during rolling deployments.
-spec compile_operation(module(), kura_migration:operation()) -> binary().
Compile a single DDL operation to SQL using RepoMod's dialect.
-spec ensure_database(module()) -> ok.
-spec ensure_schema_migrations(module()) -> ok.
Run all pending migrations in order.
Roll back the last migration.
-spec rollback(module(), non_neg_integer()) -> {ok, [integer()]} | {error, term()}.
Roll back the last Steps migrations.
Return the status of all discovered migrations (:up or :pending).
-spec wait_for_pool(module()) -> ok | {error, pool_unavailable}.
-spec wait_for_pool(module(), non_neg_integer()) -> ok | {error, pool_unavailable}.