From c97fdc2b5facc94003d773f7322229d7904b1bf0 Mon Sep 17 00:00:00 2001 From: gelbeinhalb Date: Mon, 19 Jan 2026 14:58:33 +0100 Subject: [PATCH] add match method to change created at --- lib/data/dao/match_dao.dart | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/data/dao/match_dao.dart b/lib/data/dao/match_dao.dart index 696aff7..7c67e08 100644 --- a/lib/data/dao/match_dao.dart +++ b/lib/data/dao/match_dao.dart @@ -340,6 +340,19 @@ class MatchDao extends DatabaseAccessor with _$MatchDaoMixin { return rowsAffected > 0; } + /// Updates the createdAt timestamp of the match with the given [matchId]. + /// Returns `true` if more than 0 rows were affected, otherwise `false`. + Future updateMatchCreatedAt({ + required String matchId, + required DateTime createdAt, + }) async { + final query = update(matchTable)..where((g) => g.id.equals(matchId)); + final rowsAffected = await query.write( + MatchTableCompanion(createdAt: Value(createdAt)), + ); + return rowsAffected > 0; + } + // ============================================================ // TEMPORARY: Winner methods - these are stubs and do not persist data // TODO: Implement proper winner handling