MigrationEngine<T extends Schema> class

MigrationEngine orchestrates the maintenance of the schema before and after migrations. As well as the context in which migrations should be invoked.

Constructors

MigrationEngine()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createDbBackup(T schema) → void
Runs before any migrations. Used in case a migration fails. Note: If the migration engine does not support Backups, it is perfectly valid to leave implementation empty.
dropDbBackup(T schema) → void
Drops the db backup after a successful migration or restore. Note: If the migration engine does not support Backups, it is perfectly valid to leave implementation empty.
migrationFailedAndRestoreFailedProtocol(T schema) → void
Should only be implemented if it is possible to fail a migration and then a subsequent restore. Ex: both migration and restore depend on another service that is down
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
restoreDbFromBackup(T schema) → void
Runs if a migration fails and restores the backup of the schema. Note: If the migration engine does not support Backups, it is perfectly valid to leave implementation empty.
run(T schema, Future<void> invokeMigrations(Migration, Object?)) Future<void>
///////////////////////////////////////////////////////////////////////// Runs the migrations within the schema and protects for failures.
toString() String
A string representation of this object.
inherited

Operators

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