MigrationConfig
The user-authored form of a single migration — an entry of
MigrationPackageConfig.migrations, or the shape of a
migration.json/migration.ts manifest file. Resolving it produces a
Migration.
| Property | Type | Required | Description |
|---|---|---|---|
version | number | yes | Migration version number. Must be unique within the package; migrations run in ascending order regardless of declaration order. |
backup | boolean | no | When true on any migration in the package, DbMigrator.execute() takes a backup (emits backup/calls backupDatabase()) before applying migrations, and restores it (emits restore/calls restoreDatabase()) if execution fails. |
tasks | (string | MigrationTask | (() => MigrationTask) | (() => Promise<MigrationTask>))[] | yes | Tasks to run for this version — a glob pattern matching *.task.sql/*.task.json files, an inline task object, or a (sync or async) function returning one. |
migration.json
{
"version": 13,
"tasks": ["*"]
}
MigrationTask is a union of
SqlScriptMigrationTask,
InsertDataMigrationTask, and
CustomMigrationTask. See
Writing Migration Tasks.