Function: createMigrationRunner()
createMigrationRunner(
options):object
Defined in: migrations/runner.ts:102
Runs an application's migrations against a Postgres database and records
each one in a ledger table, so a deploy can run migrate run on every
release and only what is pending happens.
The ledger records what finished, not what half-ran: a migration that throws leaves no row and is retried from the top on the next run, which is why every migration must be idempotent as well.
Parameters
| Parameter | Type |
|---|---|
options | MigrationRunnerOptions |
Returns
object
baseline
baseline: (
__namedParameters) =>Promise<string[]>
Parameters
| Parameter | Type |
|---|---|
__namedParameters | BaselineOptions |
Returns
Promise<string[]>
close
close: () =>
Promise<void>
Returns
Promise<void>
run
run: (
__namedParameters) =>Promise<RunResult>
Parameters
| Parameter | Type |
|---|---|
__namedParameters | RunOptions |
Returns
Promise<RunResult>
status
status: () =>
Promise<MigrationStatusReport>
Returns
Promise<MigrationStatusReport>