platform/packages/orm/angel_migration/lib/src/schema.dart

18 lines
479 B
Dart
Raw Normal View History

2019-02-14 17:15:34 +00:00
import 'table.dart';
abstract class Schema {
2021-05-17 15:34:19 +00:00
void drop(String tableName, {bool cascade = false});
2019-02-14 17:15:34 +00:00
2021-05-17 15:34:19 +00:00
void dropAll(Iterable<String> tableNames, {bool cascade = false}) {
2022-01-02 07:21:17 +00:00
for (var n in tableNames) {
drop(n, cascade: cascade);
}
2019-02-14 17:15:34 +00:00
}
2021-05-17 15:34:19 +00:00
void create(String tableName, void Function(Table table) callback);
2019-02-14 17:15:34 +00:00
2021-05-17 15:34:19 +00:00
void createIfNotExists(String tableName, void Function(Table table) callback);
2019-02-14 17:15:34 +00:00
2021-05-17 15:34:19 +00:00
void alter(String tableName, void Function(MutableTable table) callback);
2019-02-14 17:15:34 +00:00
}