Migration class final

One reviewed plan for one database engine. A history cannot change engines.

Constructors

Migration(String id, List<String> statements, {required SqlDialect dialect, SchemaSnapshot? snapshot, String? previous})
Builds a plan from transactional SQL statements.
Migration.create(String id, List<TableSchema> schema, {required SqlDialect dialect})
Plans creation of a new schema for dialect, without database access.
factory
Migration.diff(String id, {required SqlDialect dialect, required SchemaSnapshot from, required SchemaSnapshot to, SchemaRenames renames = const SchemaRenames(), String? previous, bool allowDestructive = false, Map<String, Map<String, String>> using = const {}})
Plans the transition from from to to, without applying any changes.
factory
Migration.steps(String id, List<MigrationStep> steps, {required SqlDialect dialect, SchemaSnapshot? snapshot, String? previous})
Builds a plan with explicit operations and freezes its engine-specific schema.

Properties

checksum → String
Stable fingerprint of SQL, operations, schema, engine, and prior checksum.
latefinal
dialect → SqlDialect
The only database engine on which this plan can run.
final
hashCode → int
The hash code for this object.
no setterinherited
id → String
Ordered identifier, such as 0001_create_users.
final
previous → String?
Checksum of the immediately preceding migration, when recorded.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
snapshot → SchemaSnapshot?
Physical schema expected after all steps complete, when recorded.
final
steps → List<MigrationStep>
Immutable operations, executed in their reviewed order.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
Canonical operation data used for reporting and checksum calculation.
toString() → String
A string representation of this object.
inherited

Operators

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