Migration
A single resolved version step inside a MigrationPackage — the
resolved counterpart of a MigrationConfig, with every task loaded.
| Property | Type | Required | Description |
|---|---|---|---|
version | number | yes | The version number this migration advances the schema to. DbMigrator runs migrations in ascending version order; two migrations in the same package can't share a version. |
tasks | MigrationTask[] (see MigrationConfig for the MigrationTask union) | yes | Resolved tasks to execute, in order, for this version. |
baseDir | string | yes | Directory this migration's own relative task-file references are resolved against. |
backup | boolean | no | If true, DbMigrator emits a backup event and calls the adapter's backupDatabase() before running the package's tasks. No bundled adapter implements a backup, so since v6.3.0 the run fails with Database backup is not supported by <Adapter>; up to v6.2.1 the flag was accepted and did nothing. Use transaction: 'run' for a run that leaves no trace when it fails. |
See Writing Migration Tasks for how migrations are laid out on disk.