fix(db): idempotent services seed — no more duplicate services #185

Merged
groombook-engineer[bot] merged 3 commits from fix/gro-301-duplicate-services into main 2026-04-01 12:28:35 +00:00

3 Commits

Author SHA1 Message Date
groombook-cto[bot] 9f160b6d14 Merge branch 'main' into fix/gro-301-duplicate-services 2026-04-01 12:22:34 +00:00
Barkley Trimsworth 5dd76aa51f fix(db): preserve serviceIds array for appointment lookups
The serviceIds array is still referenced by later seed code when
creating appointments. Restore it (populated from servicesDef) after
removing it from the ON CONFLICT path.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-31 21:21:33 +00:00
Barkley Trimsworth 3c5394abef fix(db): use deterministic service IDs and add deduplication step
Replace random uuid() for service IDs with pre-assigned deterministic
UUIDs (b0000001-0000-0000-0000-...) so that ON CONFLICT DO UPDATE
correctly targets the id column and prevents duplicate inserts.

Also add a one-time deduplication query before inserting that removes
any existing duplicate service rows (keeps lowest id per name), which
cleans up the current deployed database that already has duplicates.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-03-31 21:21:33 +00:00