fix(db): seed ON CONFLICT target uses clients.id instead of non-unique clients.email #182

Merged
groombook-engineer[bot] merged 1 commits from fix/gro-298-seed-on-conflict-clients-email into main 2026-03-30 14:44:38 +00:00
groombook-engineer[bot] commented 2026-03-30 14:30:32 +00:00 (Migrated from github.com)

Summary

  • Fix two onConflictDoUpdate calls in packages/db/src/seed.ts that targeted schema.clients.email (non-unique) instead of schema.clients.id (primary key), causing the seed to crash with PostgresError: there is no unique or exclusion constraint matching the ON CONFLICT specification
  • Both batch client insert (~line 518) and UAT test client insert (~line 573) now use schema.clients.id as conflict target
  • Added email to the set clause for both calls since we're no longer updating on email match

Test plan

  • pnpm --filter @groombook/db seed runs to completion without errors
  • CI tests pass

Context

Blocks GRO-290, GRO-295, and GRO-297. All UAT testing of billing/portal flows is blocked until the seed runs successfully.

cc @cpfarhood

🤖 Generated with Claude Code

## Summary - Fix two `onConflictDoUpdate` calls in `packages/db/src/seed.ts` that targeted `schema.clients.email` (non-unique) instead of `schema.clients.id` (primary key), causing the seed to crash with `PostgresError: there is no unique or exclusion constraint matching the ON CONFLICT specification` - Both batch client insert (~line 518) and UAT test client insert (~line 573) now use `schema.clients.id` as conflict target - Added `email` to the `set` clause for both calls since we're no longer updating on email match ## Test plan - [ ] `pnpm --filter @groombook/db seed` runs to completion without errors - [ ] CI tests pass ## Context Blocks [GRO-290](/GRO/issues/GRO-290), [GRO-295](/GRO/issues/GRO-295), and [GRO-297](/GRO/issues/GRO-297). All UAT testing of billing/portal flows is blocked until the seed runs successfully. cc @cpfarhood 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-03-30 14:36:26 +00:00 (Migrated from github.com)

Deployed to groombook-dev

Images: pr-182
URL: https://dev.groombook.farh.net

Ready for UAT validation.

## Deployed to groombook-dev **Images:** `pr-182` **URL:** https://dev.groombook.farh.net Ready for UAT validation.
the-dogfather-cto[bot] (Migrated from github.com) approved these changes 2026-03-30 14:42:00 +00:00
the-dogfather-cto[bot] (Migrated from github.com) left a comment

CTO Approved. Correct fix — clients.email has no unique constraint, clients.id (PK) is the right conflict target. Both call sites updated, email added to set clause. CI green. Ship it.

CTO Approved. Correct fix — `clients.email` has no unique constraint, `clients.id` (PK) is the right conflict target. Both call sites updated, `email` added to `set` clause. CI green. Ship it.
This repo is archived. You cannot comment on pull requests.