fix(db): make M17 20260703120100_add_deploy_fields idempotent (merge-order) #99

Merged
janpeter merged 1 commit from fix/m17-deploy-fields-idempotent into main 2026-07-04 15:22:58 +02:00
Owner

Waarom

Fase 4 (server-rollout) van het M17-DEPLOY-plan blokkeert: prisma migrate deploy zou op de live scrum4me-DB falen en de migratie als FAILED markeren (blokkeert daarna álle migraties).

Merge-volgorde-bug. De M18 fore-runner 20260704142925_claude_job_kind_deploy_prep voegt — idempotent (IF NOT EXISTS) — de DEPLOY-enumwaarde + products.auto_deploy + products.deploy_flow + claude_jobs.resolved_at al toe (zodat een M18-submodule-bump die vóór dit M17-plan landde de Prisma-client niet laat crashen). Op scrum4me-server is die fore-runner al toegepast (2026-07-04 13:03 UTC), dus die drie kolommen bestaan al.

20260703120100 her-voegde diezelfde drie kolommen toe met kale ADD COLUMN42701 "column already exists".

Fix

  • ADD COLUMN IF NOT EXISTS op de drie kolommen.
  • CREATE UNIQUE INDEX IF NOT EXISTS op de partiële dedup-index.
  • De partiële index én de claude_jobs_kind_id_consistency check-constraint worden niet door de fore-runner gemaakt en blijven de echte, nog-openstaande feature-DDL (de constraint is al replay-safe via DROP CONSTRAINT IF EXISTS + ADD).

Veilig in-place bewerkt

Géén enkele DB (lokale prod + Neon) heeft 20260703120100 al toegepast — geverifieerd via _prisma_migrations (afwezig) en de DB-staat (kolommen aanwezig, index/constraint afwezig). Dus geen Prisma-checksum-mismatch; op een verse DB draait de idempotente versie schoon.

Effect

Deblokkeert M17 Fase 4 (sprint S-2026-07-03-m17-deploy, taak T-1325). Na merge kan update_scrum4me_web de migraties schoon toepassen.

🤖 Generated with Claude Code

## Waarom Fase 4 (server-rollout) van het M17-DEPLOY-plan blokkeert: `prisma migrate deploy` zou op de live `scrum4me`-DB **falen** en de migratie als *FAILED* markeren (blokkeert daarna álle migraties). **Merge-volgorde-bug.** De M18 fore-runner `20260704142925_claude_job_kind_deploy_prep` voegt — **idempotent** (`IF NOT EXISTS`) — de `DEPLOY`-enumwaarde + `products.auto_deploy` + `products.deploy_flow` + `claude_jobs.resolved_at` al toe (zodat een M18-submodule-bump die vóór dit M17-plan landde de Prisma-client niet laat crashen). Op scrum4me-server is die fore-runner al toegepast (2026-07-04 13:03 UTC), dus die drie kolommen **bestaan al**. `20260703120100` her-voegde diezelfde drie kolommen toe met **kale `ADD COLUMN`** → `42701 "column already exists"`. ## Fix - `ADD COLUMN IF NOT EXISTS` op de drie kolommen. - `CREATE UNIQUE INDEX IF NOT EXISTS` op de partiële dedup-index. - De partiële index én de `claude_jobs_kind_id_consistency` check-constraint worden **niet** door de fore-runner gemaakt en blijven de echte, nog-openstaande feature-DDL (de constraint is al replay-safe via `DROP CONSTRAINT IF EXISTS` + `ADD`). ## Veilig in-place bewerkt Géén enkele DB (lokale prod + Neon) heeft `20260703120100` al toegepast — geverifieerd via `_prisma_migrations` (afwezig) en de DB-staat (kolommen aanwezig, index/constraint afwezig). Dus geen Prisma-checksum-mismatch; op een verse DB draait de idempotente versie schoon. ## Effect Deblokkeert M17 Fase 4 (sprint `S-2026-07-03-m17-deploy`, taak `T-1325`). Na merge kan `update_scrum4me_web` de migraties schoon toepassen. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(db): make M17 20260703120100_add_deploy_fields idempotent (merge-order)
Some checks failed
CI / Lint, Typecheck, Test & Build (pull_request) Failing after 2m52s
CI / Deploy Manual (workflow_dispatch) (pull_request) Has been skipped
CI / Detect deploy-relevant changes (pull_request) Has been skipped
CI / Deploy Preview (PR) (pull_request) Has been skipped
CI / Deploy Production (main) (pull_request) Has been skipped
31310cbbe9
The M18 fore-runner migration 20260704142925_claude_job_kind_deploy_prep
already adds (IF NOT EXISTS) the DEPLOY enum value plus products.auto_deploy,
products.deploy_flow and claude_jobs.resolved_at, so an M18 submodule-bump that
landed before this M17 plan does not crash the Prisma client on prod.

But 20260703120100 re-added those same three columns with bare ADD COLUMN. On
scrum4me-server the columns already exist (deploy_prep applied 2026-07-04
13:03 UTC), so `prisma migrate deploy` would fail on 42701 "column already
exists" and mark this migration FAILED, blocking all further migrations.

Fix: ADD COLUMN IF NOT EXISTS on the three columns + CREATE UNIQUE INDEX IF NOT
EXISTS on the partial dedup index. The partial index and the
claude_jobs_kind_id_consistency check-constraint are NOT created by the
fore-runner and remain the real, still-pending feature DDL (the constraint is
already replay-safe via DROP CONSTRAINT IF EXISTS + ADD).

Safe to edit in place: neither the local prod DB nor Neon has applied
20260703120100 yet, so no _prisma_migrations checksum mismatch. Unblocks M17
Fase 4 server-rollout (sprint S-2026-07-03-m17-deploy, task T-1325).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
janpeter/Scrum4Me!99
No description provided.