feat(engine): migrate monthly pre-update boundary

This commit is contained in:
2026-07-25 21:36:34 +00:00
parent bd57a99d0e
commit 5f390a46b9
12 changed files with 666 additions and 59 deletions
+18
View File
@@ -887,6 +887,24 @@ export const createDatabaseTurnHooks = async (
data: buildGeneralUpdate(general),
})
),
...generals
.filter(
(general) =>
typeof general.refreshScoreTotal === 'number' && Number.isFinite(general.refreshScoreTotal)
)
.map((general) =>
prisma.generalAccessLog.upsert({
where: { generalId: general.id },
update: {
refreshScoreTotal: Math.floor(general.refreshScoreTotal ?? 0),
},
create: {
generalId: general.id,
userId: general.userId ?? null,
refreshScoreTotal: Math.floor(general.refreshScoreTotal ?? 0),
},
})
),
...cities.map((city) =>
prisma.city.update({
where: { id: city.id },