Add deleteMatchGroup method & tests

This commit is contained in:
2026-03-09 15:27:15 +01:00
parent 4f91130cb5
commit 6c50eaefc7
2 changed files with 58 additions and 0 deletions

View File

@@ -338,6 +338,17 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
return rowsAffected > 0;
}
/// Entfernt die Gruppen-Verknüpfung des Matches mit der gegebenen [matchId].
/// Setzt die groupId auf null.
/// Gibt `true` zurück, wenn mehr als 0 Zeilen betroffen waren, ansonsten `false`.
Future<bool> deleteMatchGroup({required String matchId}) async {
final query = update(matchTable)..where((g) => g.id.equals(matchId));
final rowsAffected = await query.write(
const MatchTableCompanion(groupId: Value(null)),
);
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<bool> updateMatchCreatedAt({