SqlMigrationLedger class
Generic SQL ledger that persists migrations inside a driver-managed table.
- Implemented types
Constructors
- SqlMigrationLedger(DriverAdapter driver, {String? tableName, String? tablePrefix})
- SqlMigrationLedger.managed({required String connectionName, ConnectionManager? manager, ConnectionRole role = ConnectionRole.primary, String? tableName, String? tablePrefix})
Properties
Methods
-
ensureInitialized(
) → Future< void> -
Ensures the ledger storage is initialized (e.g., creates tables).
override
-
logApplied(
MigrationDescriptor descriptor, DateTime appliedAt, {required int batch}) → Future< void> -
Adds an applied migration entry to the ledger and assigns a batch number.
override
-
nextBatchNumber(
) → Future< int> -
Determines the next batch number to use when logging migrations.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readApplied(
) → Future< List< AppliedMigrationRecord> > -
Returns all applied migrations ordered by application time ascending.
override
-
remove(
MigrationId id) → Future< void> -
Removes the migration entry from the ledger (used during rollbacks).
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited