toPgSql method
Implementation
String toPgSql() {
var out = '';
switch (type) {
case DatabaseMigrationActionType.deleteTable:
out += '--\n';
out += '-- ACTION DROP TABLE\n';
out += '--\n';
out += 'DROP TABLE "$deleteTable" CASCADE;\n';
out += '\n';
break;
case DatabaseMigrationActionType.createTable:
out += '--\n';
out += '-- ACTION CREATE TABLE\n';
out += '--\n';
out += createTable!.tableCreationToPgsql();
break;
case DatabaseMigrationActionType.createTableIfNotExists:
out += '--\n';
out += '-- ACTION CREATE TABLE IF NOT EXISTS\n';
out += '--\n';
out += createTable!.tableCreationToPgsql(ifNotExists: true);
break;
case DatabaseMigrationActionType.alterTable:
out += '--\n';
out += '-- ACTION ALTER TABLE\n';
out += '--\n';
out += alterTable!.toPgSql();
break;
}
return out;
}