Skip to main content

Migration

A single resolved version step inside a MigrationPackage — the resolved counterpart of a MigrationConfig, with every task loaded.

PropertyTypeRequiredDescription
versionnumberyesThe 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.
tasksMigrationTask[] (see MigrationConfig for the MigrationTask union)yesResolved tasks to execute, in order, for this version.
baseDirstringyesDirectory this migration's own relative task-file references are resolved against.
backupbooleannoIf 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.