MigrationPackageConfig
The user-authored, not-yet-resolved form of a migration package — what you pass as
migrationPackage to DbMigrator.execute(), or to
MigrationPackage.load() directly. Resolving one (loading glob patterns, manifest files,
and functions) produces a MigrationPackage.
| Property | Type | Required | Description |
|---|---|---|---|
name | string | yes | Package name. Used as the row key in the migration_summary bookkeeping table, so it should be stable and unique per application/schema. |
description | string | no | Free-text description. |
baseDir | string | no | Base directory that string glob patterns in migrations are resolved against. Defaults to the directory of the file that called MigrationPackage.load(). |
informationTableName | string | no | Reserved for future use. |
migrations | (string | MigrationConfig | (() => MigrationConfig) | (() => Promise<MigrationConfig>))[] | yes | Migrations to include — a glob pattern (discovers migration.json/migration.ts/migration.js/migration.cjs/migration.mjs manifest files), an inline MigrationConfig object, or a (sync or async) function returning one. |
import type { MigrationPackageConfig } from '@sqb/migrator';
const config: MigrationPackageConfig = {
name: 'my-app',
migrations: ['migrations/**/*'],
};
See Writing Migration Tasks for the
two ways of laying out migrations (inline vs. folder discovery).