update onDelete behavior for groupId in match_table to set null
This commit is contained in:
@@ -7,8 +7,10 @@ class MatchTable extends Table {
|
||||
TextColumn get gameId =>
|
||||
text().references(GameTable, #id, onDelete: KeyAction.cascade)();
|
||||
// Nullable if there is no group associated with the match
|
||||
TextColumn get groupId =>
|
||||
text().references(GroupTable, #id, onDelete: KeyAction.cascade).nullable()();
|
||||
// onDelete: If a group gets deleted, groupId in the match gets set to null
|
||||
TextColumn get groupId => text()
|
||||
.references(GroupTable, #id, onDelete: KeyAction.setNull)
|
||||
.nullable()();
|
||||
TextColumn get name => text().nullable()();
|
||||
TextColumn get notes => text().nullable()();
|
||||
DateTimeColumn get createdAt => dateTime()();
|
||||
@@ -16,4 +18,4 @@ class MatchTable extends Table {
|
||||
|
||||
@override
|
||||
Set<Column<Object>> get primaryKey => {id};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user