MigrationPackage
The fully-resolved form of a migration package — glob patterns expanded, manifest files loaded,
and functions awaited. MigrationPackage.load() turns a MigrationPackageConfig
into one of these; DbMigrator.execute() accepts either form directly.
| Property | Type | Required | Description |
|---|---|---|---|
name | string | yes | Package name, used as the row key in the migration bookkeeping table. |
description | string | no | Free-text description. |
migrations | Migration[] | yes | Resolved migrations, sorted by version ascending. |
baseDir | string | yes | Base directory migrations were resolved against. |
informationTableName | string | no | Reserved for future use. |
import { MigrationPackage } from '@sqb/migrator';
const pkg = await MigrationPackage.load({
name: 'my-app',
migrations: ['migrations/**/*'],
});
See MigrationPackage.load() usage in the
Running Migrations guide.