addColumn method Null safety

Future<void> addColumn(
  1. TableInfo<Table, dynamic> table,
  2. GeneratedColumn<Object> column
)

Adds the given column to the specified table.

Implementation

Future<void> addColumn(TableInfo table, GeneratedColumn column) async {
  final context = _createContext();

  context.buffer
      .write('ALTER TABLE ${escapeIfNeeded(table.aliasedName)} ADD COLUMN ');
  column.writeColumnDefinition(context);
  context.buffer.write(';');

  return _issueCustomQuery(context.sql);
}