RebuildTable constructor
RebuildTable(
- TableSchema before,
- TableSchema after, {
- required Map<
String, String> copy,
Freezes an explicit copy map between two shapes of the same SQLite table.
The map must be nonempty and may target only existing, noncomputed columns.
Implementation
RebuildTable(this.before, this.after, {required Map<String, String> copy})
: copy = Map.unmodifiable(copy) {
if (before.name != after.name ||
copy.isEmpty ||
copy.keys.any(
(key) =>
!after.columns.any((c) => c.name == key && c.computed == null),
)) {
throw const OrmException(
'MIGRATION.REBUILD',
'Rebuild requires the same table name and an explicit target-column copy map.',
);
}
}