compileAlter method

List<String> compileAlter(
  1. Blueprint blueprint
)

One statement per added column, column index and command.

Implementation

List<String> compileAlter(Blueprint blueprint) {
  final table = wrap(blueprint.table);
  return [
    for (final c in blueprint.columns)
      'alter table $table add column ${compileColumn(c)}',
    for (final i in blueprint.columnIndexes) compileIndex(blueprint.table, i),
    for (final command in blueprint.commands)
      compileCommand(blueprint.table, command),
  ];
}