Compare commits
2 Commits
4c8896d2d9
...
b8b65c4ca1
| Author | SHA1 | Date | |
|---|---|---|---|
| b8b65c4ca1 | |||
| 356cb1fb43 |
@@ -21,7 +21,7 @@ class GroupMatchDao extends DatabaseAccessor<AppDatabase>
|
|||||||
}
|
}
|
||||||
await into(groupMatchTable).insert(
|
await into(groupMatchTable).insert(
|
||||||
GroupMatchTableCompanion.insert(groupId: groupId, matchId: matchId),
|
GroupMatchTableCompanion.insert(groupId: groupId, matchId: matchId),
|
||||||
mode: InsertMode.insertOrReplace,
|
mode: InsertMode.insertOrIgnore,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,6 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (match.players != null) {
|
if (match.players != null) {
|
||||||
await db.playerDao.addPlayersAsList(players: match.players!);
|
|
||||||
for (final p in match.players ?? []) {
|
for (final p in match.players ?? []) {
|
||||||
await db.playerMatchDao.addPlayerToMatch(
|
await db.playerMatchDao.addPlayerToMatch(
|
||||||
matchId: match.id,
|
matchId: match.id,
|
||||||
@@ -90,7 +89,6 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (match.group != null) {
|
if (match.group != null) {
|
||||||
await db.groupDao.addGroup(group: match.group!);
|
|
||||||
await db.groupMatchDao.addGroupToMatch(
|
await db.groupMatchDao.addGroupToMatch(
|
||||||
matchId: match.id,
|
matchId: match.id,
|
||||||
groupId: match.group!.id,
|
groupId: match.group!.id,
|
||||||
@@ -186,7 +184,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
|||||||
matchId: match.id,
|
matchId: match.id,
|
||||||
playerId: p.id,
|
playerId: p.id,
|
||||||
),
|
),
|
||||||
mode: InsertMode.insertOrReplace,
|
mode: InsertMode.insertOrIgnore,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -204,7 +202,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
|||||||
playerId: m.id,
|
playerId: m.id,
|
||||||
groupId: match.group!.id,
|
groupId: match.group!.id,
|
||||||
),
|
),
|
||||||
mode: InsertMode.insertOrReplace,
|
mode: InsertMode.insertOrIgnore,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -221,7 +219,7 @@ class MatchDao extends DatabaseAccessor<AppDatabase> with _$MatchDaoMixin {
|
|||||||
matchId: match.id,
|
matchId: match.id,
|
||||||
groupId: match.group!.id,
|
groupId: match.group!.id,
|
||||||
),
|
),
|
||||||
mode: InsertMode.insertOrReplace,
|
mode: InsertMode.insertOrIgnore,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class PlayerMatchDao extends DatabaseAccessor<AppDatabase>
|
|||||||
}) async {
|
}) async {
|
||||||
await into(playerMatchTable).insert(
|
await into(playerMatchTable).insert(
|
||||||
PlayerMatchTableCompanion.insert(playerId: playerId, matchId: matchId),
|
PlayerMatchTableCompanion.insert(playerId: playerId, matchId: matchId),
|
||||||
mode: InsertMode.insertOrReplace,
|
mode: InsertMode.insertOrIgnore,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ class PlayerMatchDao extends DatabaseAccessor<AppDatabase>
|
|||||||
inserts.map(
|
inserts.map(
|
||||||
(c) => into(
|
(c) => into(
|
||||||
playerMatchTable,
|
playerMatchTable,
|
||||||
).insert(c, mode: InsertMode.insertOrReplace),
|
).insert(c, mode: InsertMode.insertOrIgnore),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user