deleteTable method Null safety

void deleteTable(
  1. String tableName
)

Validates and deletes a table in schema.

Implementation

void deleteTable(String tableName) {
  final table = schema!.tableForName(tableName);
  if (table == null) {
    throw SchemaException("Table $tableName does not exist.");
  }

  schema!.removeTable(table);

  if (store != null) {
    commands.addAll(store!.deleteTable(table));
  } else {
    commands.add('database.deleteTable("$tableName");');
  }
}