createPgMigrator
FunctionExperimentalSignature
function createPgMigrator<TTxContext>(__namedParameters): Migrator;postgres/src/migration-store/migration-store.pg.ts:240
Type Parameters
- TTxContextextends
BaseTxContext
Parameters
- __namedParameters
object - __namedParameters.after?Runs under the lease after the migrations have run, unless one failed. Records nothing.
- __namedParameters.before?Runs under the lease on every run, before the history is read. Records nothing.
- __namedParameters.lock?
objectTiming of the lease. - __namedParameters.lock.heartbeatIntervalMs?
numberHow often the lease is extended while migrating. Below a third ofttlMs. - __namedParameters.lock.pollIntervalMs?
numberHow often a waiting process re-attempts to claim the lease. - __namedParameters.lock.ttlMs?
numberHow long a claimed lease stays valid without a heartbeat. - __namedParameters.lockTableName?
stringTable that holds the migration lease. - __namedParameters.migrations
Migration<NoInfer<TTxContext>>[]The migrations, in the order they run. Append new migrations at the end. - __namedParameters.migrationTableName?
stringTable that records applied migrations. - __namedParameters.schema?
stringSchema of the history and lease tables, created if missing. - __namedParameters.stateProvider
PgStateProvider<TTxContext>The provider the migrator keeps its history and lease through.