Migration.diff constructor

Migration.diff(
  1. String id, {
  2. required SqlDialect dialect,
  3. required SchemaSnapshot from,
  4. required SchemaSnapshot to,
  5. SchemaRenames renames = const SchemaRenames(),
  6. String? previous,
  7. bool allowDestructive = false,
  8. Map<String, Map<String, String>> using = const {},
})

Plans the transition from from to to, without applying any changes.

Renames must be explicit in renames. Potential data loss requires allowDestructive; using supplies reviewed conversion SQL by table and column. Review the returned steps before adding the plan to a history.

Implementation

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 {},
}) => diffSchema(
  id,
  dialect: dialect,
  from: from.forDialect(dialect),
  to: to.forDialect(dialect),
  renames: renames,
  previous: previous,
  allowDestructive: allowDestructive,
  using: using,
);