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 takes a database backup before running this migration's tasks (emits a backup event), and restores it automatically if a task fails (emits a restore event). |
See Writing Migration Tasks for how migrations are laid out on disk.