Finalized and updated team implementation, updated team dao, tests, and ex-/import
This commit is contained in:
@@ -2122,7 +2122,7 @@ class $PlayerMatchTableTable extends PlayerMatchTable
|
||||
type: DriftSqlType.string,
|
||||
requiredDuringInsert: false,
|
||||
defaultConstraints: GeneratedColumn.constraintIsAlways(
|
||||
'REFERENCES team_table (id)',
|
||||
'REFERENCES team_table (id) ON DELETE SET NULL',
|
||||
),
|
||||
);
|
||||
@override
|
||||
@@ -2820,6 +2820,13 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||
),
|
||||
result: [TableUpdate('player_match_table', kind: UpdateKind.delete)],
|
||||
),
|
||||
WritePropagation(
|
||||
on: TableUpdateQuery.onTableName(
|
||||
'team_table',
|
||||
limitUpdateKind: UpdateKind.delete,
|
||||
),
|
||||
result: [TableUpdate('player_match_table', kind: UpdateKind.update)],
|
||||
),
|
||||
WritePropagation(
|
||||
on: TableUpdateQuery.onTableName(
|
||||
'player_table',
|
||||
|
||||
@@ -8,7 +8,9 @@ class PlayerMatchTable extends Table {
|
||||
text().references(PlayerTable, #id, onDelete: KeyAction.cascade)();
|
||||
TextColumn get matchId =>
|
||||
text().references(MatchTable, #id, onDelete: KeyAction.cascade)();
|
||||
TextColumn get teamId => text().references(TeamTable, #id).nullable()();
|
||||
TextColumn get teamId => text()
|
||||
.references(TeamTable, #id, onDelete: KeyAction.setNull)
|
||||
.nullable()();
|
||||
|
||||
@override
|
||||
Set<Column<Object>> get primaryKey => {playerId, matchId};
|
||||
|
||||
Reference in New Issue
Block a user