From 5a33bdc24d95d4c34e3177339748b1f12d57b574 Mon Sep 17 00:00:00 2001 From: mathiskirchner Date: Sun, 29 Jun 2025 21:25:05 +0200 Subject: [PATCH] rename SQL update methods to include 'ById' --- lib/data/dao/game_dao.dart | 2 +- lib/data/dao/group_dao.dart | 2 +- lib/data/dao/result_placement_dao.dart | 2 +- lib/data/dao/result_score_dao.dart | 2 +- lib/data/dao/result_win_dao.dart | 2 +- lib/data/dao/user_dao.dart | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/data/dao/game_dao.dart b/lib/data/dao/game_dao.dart index 9d11d55..9b6c7f8 100644 --- a/lib/data/dao/game_dao.dart +++ b/lib/data/dao/game_dao.dart @@ -22,7 +22,7 @@ extension GameDao on AppDatabase { await (delete(gameTable)..where((ga) => ga.id.equals(id))).go(); } - Future updateGameName(int id, String newName) async { + Future updateGameNameById(int id, String newName) async { await (update(gameTable)..where((ga) => ga.id.equals(id))).write( GameTableCompanion(name: Value(newName)), ); diff --git a/lib/data/dao/group_dao.dart b/lib/data/dao/group_dao.dart index 496989a..7c572a9 100644 --- a/lib/data/dao/group_dao.dart +++ b/lib/data/dao/group_dao.dart @@ -22,7 +22,7 @@ extension GroupDao on AppDatabase { await (delete(groupTable)..where((gr) => gr.id.equals(id))).go(); } - Future updateGroupName(String id, String newName) async { + Future updateGroupNameById(String id, String newName) async { await (update(groupTable)..where((gr) => gr.id.equals(id))).write( GroupTableCompanion(name: Value(newName)), ); diff --git a/lib/data/dao/result_placement_dao.dart b/lib/data/dao/result_placement_dao.dart index dd3eb48..7816a28 100644 --- a/lib/data/dao/result_placement_dao.dart +++ b/lib/data/dao/result_placement_dao.dart @@ -28,7 +28,7 @@ extension ResultPlacementDao on AppDatabase { await (delete(resultPlacementTable)..where((rP) => rP.matchId.equals(matchId))).go(); } - Future updateResultPlacement(String matchId, String userId, int placement) async { + Future updateResultPlacementByMatchIdAndUserId(String matchId, String userId, int placement) async { await (update(resultPlacementTable)..where((rP) => rP.matchId.equals(matchId))..where((rP) => rP.userId.equals(userId))).write( ResultPlacementTableCompanion(placement: Value(placement)), ); diff --git a/lib/data/dao/result_score_dao.dart b/lib/data/dao/result_score_dao.dart index f100551..e582b9a 100644 --- a/lib/data/dao/result_score_dao.dart +++ b/lib/data/dao/result_score_dao.dart @@ -28,7 +28,7 @@ extension ResultScoreDao on AppDatabase { await (delete(resultScoreTable)..where((rS) => rS.matchId.equals(matchId))).go(); } - Future updateResultScore(String matchId, String userId, int score) async { + Future updateResultScoreByMatchIdAndUserId(String matchId, String userId, int score) async { await (update(resultScoreTable)..where((rS) => rS.matchId.equals(matchId))..where((rS) => rS.userId.equals(userId))).write( ResultScoreTableCompanion(score: Value(score)), ); diff --git a/lib/data/dao/result_win_dao.dart b/lib/data/dao/result_win_dao.dart index 3b93910..4c97241 100644 --- a/lib/data/dao/result_win_dao.dart +++ b/lib/data/dao/result_win_dao.dart @@ -28,7 +28,7 @@ extension ResultWinDao on AppDatabase { await (delete(resultWinTable)..where((rW) => rW.matchId.equals(matchId))).go(); } - Future updateResultWin(String matchId, String newWinnerId) async { + Future updateResultWinByMatchIdAndUserId(String matchId, String newWinnerId) async { await (update(resultWinTable)..where((rW) => rW.matchId.equals(matchId))).write( ResultWinTableCompanion(winnerId: Value(newWinnerId)), ); diff --git a/lib/data/dao/user_dao.dart b/lib/data/dao/user_dao.dart index 2cb95b1..c305c76 100644 --- a/lib/data/dao/user_dao.dart +++ b/lib/data/dao/user_dao.dart @@ -18,7 +18,7 @@ extension UserDao on AppDatabase { await (delete(userTable)..where((u) => u.id.equals(id))).go(); } - Future updateUsername(String id, String newName) async { + Future updateUsernameById(String id, String newName) async { await (update(userTable)..where((u) => u.id.equals(id))).write( UserTableCompanion(name: Value(newName)), );