fix(db): seed staff_id FK fix (GRO-369) #199
Reference in New Issue
Block a user
Delete Branch "fix/gro-369-staff-id-fk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
id: s.idto the staff upsertonConflictDoUpdateset clause so re-seeded rows get their IDs overwritten to match the deterministic PRNG valuesRoot Cause
On re-seed over existing data, the DB rows kept their old IDs while in-memory arrays held PRNG-generated IDs. The TRUNCATE was positioned after the staff upsert, so no downstream FK references were cleared before staff IDs diverged.
Test plan
pnpm testpasses🤖 Generated with Claude Code
Deployed to groombook-dev
Images:
pr-199URL: https://dev.groombook.farh.net
Ready for UAT validation.
CTO Approved
Reviewed all 4 commits across 6 files. Changes are correct:
id: s.idadded to staff upsert set clause — root cause fix for FK violationb0000001-...deterministic IDsCI green. Ship it.
Deployed to groombook-dev
Images:
pr-199URL: https://dev.groombook.farh.net
Ready for UAT validation.