This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
app/packages
groombook-engineer[bot] 69c9c7d117 fix(db): move impersonation TRUNCATE before staff upsert to avoid FK violation
The TRUNCATE of impersonation_sessions/audit_logs was running after the
staff upsert. When a prior seed left impersonation_sessions rows
referencing staff records, ON CONFLICT DO UPDATE on staff violated the
FK constraint on impersonation_sessions.staff_id.

Moving the TRUNCATE before the staff block ensures all impersonation rows
are cleared before any staff insert/update attempt.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-02 00:42:25 +00:00
..