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:
+5
-2
@@ -169,7 +169,7 @@ export async function seed() {
|
|||||||
|
|
||||||
const slotRows: (typeof slots.$inferInsert)[] = [];
|
const slotRows: (typeof slots.$inferInsert)[] = [];
|
||||||
for (const inst of instanceRows) {
|
for (const inst of instanceRows) {
|
||||||
roleRows2.forEach((role, i) => {
|
roleRows2.forEach((role) => {
|
||||||
const callTime = role.callTimeOffsetMinutes
|
const callTime = role.callTimeOffsetMinutes
|
||||||
? new Date(inst.startsAt!.getTime() + role.callTimeOffsetMinutes * 60000)
|
? new Date(inst.startsAt!.getTime() + role.callTimeOffsetMinutes * 60000)
|
||||||
: null;
|
: null;
|
||||||
@@ -178,7 +178,10 @@ export async function seed() {
|
|||||||
serviceInstanceId: inst.id,
|
serviceInstanceId: inst.id,
|
||||||
eventId: null,
|
eventId: null,
|
||||||
roleId: role.id,
|
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,
|
callTime,
|
||||||
status: "open",
|
status: "open",
|
||||||
slotNote: null,
|
slotNote: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user