trying to add score updates

This commit is contained in:
2026-05-06 20:00:30 +01:00
parent 94c139c7b8
commit fdfbd4c7c7
7 changed files with 32 additions and 642 deletions

View File

@@ -148,23 +148,18 @@ async function seed() {
for (const row of eventAttributionsCSV) {
const eventId = eventMap.get(row.eventID);
const playerId = playerMap.get(row.playerID);
const placement = parseInt(row.placement);
if (!eventId) throw new Error(`Event "${row.eventID}" not found`);
if (!playerId) throw new Error(`Player "${row.playerID}" not found`);
if (placement <= 0) continue;
const result = await db
.insert(schema.eventAttributions)
.values({
eventID: eventId,
playerID: playerId,
placement
playerID: playerId
})
.returning();
console.log(
` Inserted attribution: event=${row.eventID}, player=${row.playerID}, placement=${placement}`
);
console.log(` Inserted attribution: event=${row.eventID}, player=${row.playerID}`);
}
console.log('\nSeeding complete!');