fix(seed): one seat per role per instance
CI / build (push) Has been cancelled

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 <noreply@codebuff.com>
This commit is contained in:
2026-11-22 22:11:21 +00:00
parent f71952f838
commit b42700a943
+5 -2
View File
@@ -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,