diff --git a/src/db/seed.ts b/src/db/seed.ts index f64ca7b..ad93bf1 100644 --- a/src/db/seed.ts +++ b/src/db/seed.ts @@ -169,7 +169,7 @@ export async function seed() { const slotRows: (typeof slots.$inferInsert)[] = []; for (const inst of instanceRows) { - roleRows2.forEach((role, i) => { + roleRows2.forEach((role) => { const callTime = role.callTimeOffsetMinutes ? new Date(inst.startsAt!.getTime() + role.callTimeOffsetMinutes * 60000) : null; @@ -178,7 +178,10 @@ export async function seed() { serviceInstanceId: inst.id, eventId: null, roleId: role.id, - slotIndex: i + 1, + // One seat per role per instance; the app also numbers every role's + // first seat 1, so a different index would insert duplicate seats on + // instances that already exist. + slotIndex: 1, callTime, status: "open", slotNote: null,