add groupid gameid and notes to match

This commit is contained in:
gelbeinhalb
2026-01-12 11:30:37 +01:00
parent 7e6c309de0
commit d8abad6fd8

View File

@@ -1,9 +1,15 @@
import 'package:drift/drift.dart';
import 'package:game_tracker/data/db/tables/game_table.dart';
import 'package:game_tracker/data/db/tables/group_table.dart';
class MatchTable extends Table {
TextColumn get id => text()();
TextColumn get name => text()();
late final winnerId = text().nullable()();
TextColumn get name => text().nullable()();
TextColumn get gameId =>
text().references(GameTable, #id, onDelete: KeyAction.cascade)();
TextColumn get groupId =>
text().references(GroupTable, #id, onDelete: KeyAction.cascade).nullable()(); // Nullable if not part of a group
TextColumn get notes => text().nullable()();
DateTimeColumn get createdAt => dateTime()();
@override