SqliteMigrationRunner class

Applies, records, and rolls back SQLite migrations.

Constructors

SqliteMigrationRunner({SqliteMigrationPlanner planner = const SqliteMigrationPlanner()})
Creates a SQLite migration runner.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
planner SqliteMigrationPlanner
Planner used to compute schema transitions.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

ensureHistoryTable(Database database) → void
Ensures the migration history table exists and contains all known columns.
loadActiveHistory(Database database) List<SqliteMigrationRecord>
Loads only the currently active apply records.
loadHistory(Database database) List<SqliteMigrationRecord>
Loads the full migration history ordered by application time.
markMigrationApplied({required Database database, required String migrationName, required int statementCount, required String checksum, required String beforeSchema, required String afterSchema, required List<String> warnings, required bool rebuildRequired}) bool
Inserts an apply record without executing schema statements.
markMigrationRolledBack({required Database database, required String migrationName, String? rollbackName}) bool
Inserts a rollback record without executing schema statements.
migrateToSchema({required Database database, required SchemaDocument target, required String migrationName, bool allowWarnings = false}) SqliteMigrationResult
Applies the schema diff to target and writes a history record.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pushToSchema({required Database database, required SchemaDocument target, bool allowWarnings = false}) SqliteMigrationResult
Applies the schema diff to target without writing migration history.
rollbackToSchema({required Database database, required SchemaDocument target, required String targetMigrationName, String? rollbackName, bool allowWarnings = false}) SqliteRollbackResult
Rolls migration history back to targetMigrationName.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Constants

historyTableName → const String
Migration history table name.
providerName → const String
Provider name stored with history records and checksums.