Skip to main content

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.

PropertyTypeRequiredDescription
namestringyesPackage name, used as the row key in the migration bookkeeping table.
descriptionstringnoFree-text description.
migrationsMigration[]yesResolved migrations, sorted by version ascending.
baseDirstringyesBase directory migrations were resolved against.
informationTableNamestringnoReserved 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.