plan method
SchemaPlan
plan(
- MigrationDirection direction, {
- SchemaSnapshot? snapshot,
- String? defaultSchema,
- String? tablePrefix,
Builds a plan for the requested direction.
Implementation
SchemaPlan plan(
MigrationDirection direction, {
SchemaSnapshot? snapshot,
String? defaultSchema,
String? tablePrefix,
}) {
final builder = SchemaBuilder(
snapshot: snapshot,
defaultSchema: defaultSchema,
tablePrefix: tablePrefix,
);
switch (direction) {
case MigrationDirection.up:
up(builder);
break;
case MigrationDirection.down:
down(builder);
break;
}
final description = '${direction.name}:${runtimeType.toString()}';
return builder.build(description: description);
}