Migration.steps constructor
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.
Implementation
Migration.steps(
this.id,
List<MigrationStep> steps, {
required this.dialect,
SchemaSnapshot? snapshot,
this.previous,
}) : steps = List.unmodifiable(steps.map((s) => _targetStep(s, dialect))),
snapshot = snapshot?.forDialect(dialect) {
if (!RegExp(r'^[0-9]+_[a-z][a-z0-9_]*$').hasMatch(id)) {
throw ArgumentError(
'Migration IDs use a numeric prefix and lowercase name.',
);
}
}