fix(db): seed staff_id FK fix (GRO-369) #199

Merged
groombook-engineer[bot] merged 5 commits from fix/gro-369-staff-id-fk into main 2026-04-01 14:19:49 +00:00
Showing only changes of commit 7fb5ddbbd1 - Show all commits
+3
View File
@@ -423,6 +423,9 @@ async function seed() {
}
console.log(`✓ Created ${allStaff.length} staff (1 manager, 1 receptionist, 3 groomers, 3 bathers)`);
// Truncate downstream tables before services dedup to avoid FK violation
await db.execute(sql`TRUNCATE appointments, invoices, invoice_line_items, invoice_tip_splits, grooming_visit_logs CASCADE`);
// ── Services ──
// Deduplicate existing services (keep lowest id per name) before inserting.
await db.execute(sql`