From b42700a943337dcc795b5cb9a51abb4e2c40dfae Mon Sep 17 00:00:00 2001 From: Tiel Coder Date: Sun, 22 Nov 2026 22:11:21 +0000 Subject: [PATCH] fix(seed): one seat per role per instance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The seed numbered seats by role position, so Livestream became seat 2 and Slides seat 3. Existing instances number every role's first seat 1, so the insert did not match them and added a duplicate Livestream and Slides seat to every Sunday. Always use seat 1. 🤖 Generated with Codebuff Co-Authored-By: Codebuff --- src/db/seed.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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,