Skip to content

Type Alias: MigrationRunOptions ​

MigrationRunOptions = object

How Database.runMigrations and Database.undoLastMigration run the migrations: in transactions or not, for real or only recorded.

Properties ​

fake? ​

optional fake?: boolean

Record the migrations as run (or remove them as reverted) in the migrations table without running their up() (or down()): for a database whose schema is already up to date.

Default ​

ts
false

transaction? ​

optional transaction?: "all" | "none" | "each"

The transactions wrapping the migrations: 'all' runs them all in one transaction (one failure rolls them all back), 'each' runs each one in its own transaction (the ones before a failure stay applied), 'none' runs them without a transaction. With 'each' or 'none', runMigrations() lets a migration choose with its own transaction property; with 'all', a pending migration having one fails the run (ForbiddenTransactionModeOverrideError). undoLastMigration() reverts in a transaction unless 'none', whatever the property of the migration.

Default ​

The migrationsTransactionMode of the connection options for runMigrations(), else 'all'

Released under the MIT License.