replaceColumn method Null safety
- SchemaColumn existingColumn,
- SchemaColumn newColumn
Replaces existingColumn
with newColumn
in this table.
Implementation
void replaceColumn(SchemaColumn existingColumn, SchemaColumn newColumn) {
if (!columns.contains(existingColumn)) {
throw SchemaException(
"Column ${existingColumn.name} does not exist on $name.",
);
}
final index = _columnStorage!.indexOf(existingColumn);
_columnStorage![index] = newColumn;
newColumn.table = this;
existingColumn.table = null;
}