replaceTable method Null safety
- SchemaTable existingTable,
- SchemaTable newTable
Implementation
void replaceTable(SchemaTable existingTable, SchemaTable newTable) {
if (!_tableStorage!.contains(existingTable)) {
throw SchemaException(
"Table ${existingTable.name} does not exist and cannot be replaced.",
);
}
final index = _tableStorage!.indexOf(existingTable);
_tableStorage![index] = newTable;
newTable.schema = this;
existingTable.schema = null;
}