migration library

Schema migration engine for the Basalt Dart ORM.

A second entrypoint of package:basalt, kept separate from package:basalt/basalt.dart so plain ORM users don't pull in migration types unless they need them. Use MigrationRunner with a MigrationSource implementation (disk, assets, or custom) to apply versioned SQL files and track them in __basalt_schema_migrations.

Classes

Migration Schema Migrations
One migration: <version>_<name> with resolved up / optional down SQL.
MigrationRunner Schema Migrations
Driver-agnostic migration engine: runs SQL against any Connection and tracks applied versions. Migration files are supplied by a MigrationSource.
MigrationSource Schema Migrations
Supplies migrations to MigrationRunner.

Functions

createSchemaMigrationsTableSql(SqlDialect dialect) String
DDL for the internal migration tracker table, quoted for dialect.

Typedefs

MigrationStatus = ({List<String> applied, List<Migration> pending})
Snapshot of which migrations have run and which are pending.