declareColumn method
MigrationColumn
declareColumn(
- String name,
- Column column
)
inherited
Implementation
@override
MigrationColumn declareColumn(String name, Column column) {
if (_columns.containsKey(name)) {
throw StateError('Cannot redeclare column $name.');
}
var col = MigrationColumn.from(column);
// Checks the precision and scale against the database's limits when the
// column is declared, before any of the schema is run.
compileColumn(col);
_columns[name] = col;
_add(_AddedColumn(name), [name]);
_statements.last.introduced.add(_key(name));
return col;
}