trying to add score updates
This commit is contained in:
@@ -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!');
|
||||
|
||||
Reference in New Issue
Block a user