createTable method
Generates a CREATE TABLE statement.
With ifNotExists, an existing table with this name is left alone.
Implementation
@override
String createTable(TableInfo table, {bool ifNotExists = false}) {
final defs = [
...table.columns.map(_columnDefinition),
for (final entry in table.checks.entries)
'CONSTRAINT ${escapeName(entry.key)} CHECK (${entry.value})',
].join(',\n ');
final exists = ifNotExists ? 'IF NOT EXISTS ' : '';
return 'CREATE TABLE $exists${escapeName(table.name)} (\n $defs\n);';
}