fix(db): register extra_large via migration 0038 (GRO-1999) #130

Merged
The Dogfather merged 1 commits from flea/gro-1999-migration-0038 into dev 2026-06-01 14:49:47 +00:00
Member

Summary

GRO-1979 added 0037_add_extra_large_to_pet_size_category with a journal when of 1751500000000 — below the 0033 high-water mark (1779500000000) on existing UAT/persistent DBs. Drizzle only applies a migration when its journal.when is strictly greater than max(applied created_at), so 0037 was silently skipped on the existing UAT DB, leaving pet_size_category without extra_large and crashlooping the UAT seed-test-data job with 22P02 invalid input value for enum pet_size_category: "extra_large".

This adds migration 0038 with a monotonic when: 1780000000000 so it applies on both existing UAT/persistent DBs and fresh DBs. The statement is idempotent (ADD VALUE IF NOT EXISTS) and a single auto-commit DDL (ADD VALUE cannot run inside a transaction block — same as 0037).

Changes

  • packages/db/migrations/0038_register_extra_large_pet_size_category.sql (new)
  • packages/db/migrations/meta/_journal.json — append idx: 38, when: 1780000000000, tag: 0038_register_extra_large_pet_size_category

Scope guardrails honored

  • ONE migration file + ONE journal entry only.
  • Did NOT touch seed.ts (it already uses extra_large per the drizzle PetSizeCategory type).
  • Did NOT modify 0033/0034/0036/0037.
  • Did NOT self-merge.

Verification

  • _journal.json validates as JSON (38 entries; when=1780000000000 is strictly > current max 1779500000000).
  • Migration file is the single standalone DDL required (ADD VALUE cannot run in a txn block).
  • After merge to dev and on the next migrate-schema run, the pet_size_category enum should include extra_large. To verify post-deploy: SELECT enumlabel FROM pg_enum WHERE enumtypid = 'pet_size_category'::regtype ORDER BY enumsortorder; should show {small, medium, large, xlarge, extra_large}.

cc @cpfarhood

🤖 Generated with Claude Code

Co-Authored-By: Paperclip noreply@paperclip.ing

## Summary GRO-1979 added 0037_add_extra_large_to_pet_size_category with a journal `when` of 1751500000000 — below the 0033 high-water mark (1779500000000) on existing UAT/persistent DBs. Drizzle only applies a migration when its `journal.when` is strictly greater than `max(applied created_at)`, so 0037 was **silently skipped** on the existing UAT DB, leaving `pet_size_category` without `extra_large` and crashlooping the UAT `seed-test-data` job with `22P02 invalid input value for enum pet_size_category: "extra_large"`. This adds migration 0038 with a monotonic `when: 1780000000000` so it applies on **both** existing UAT/persistent DBs and fresh DBs. The statement is idempotent (`ADD VALUE IF NOT EXISTS`) and a single auto-commit DDL (ADD VALUE cannot run inside a transaction block — same as 0037). ## Changes - `packages/db/migrations/0038_register_extra_large_pet_size_category.sql` (new) - `packages/db/migrations/meta/_journal.json` — append `idx: 38`, `when: 1780000000000`, `tag: 0038_register_extra_large_pet_size_category` ## Scope guardrails honored - ONE migration file + ONE journal entry only. - Did NOT touch `seed.ts` (it already uses `extra_large` per the drizzle `PetSizeCategory` type). - Did NOT modify 0033/0034/0036/0037. - Did NOT self-merge. ## Verification - `_journal.json` validates as JSON (38 entries; `when=1780000000000` is strictly > current max `1779500000000`). - Migration file is the single standalone DDL required (`ADD VALUE` cannot run in a txn block). - After merge to dev and on the next migrate-schema run, the `pet_size_category` enum should include `extra_large`. To verify post-deploy: `SELECT enumlabel FROM pg_enum WHERE enumtypid = 'pet_size_category'::regtype ORDER BY enumsortorder;` should show {small, medium, large, xlarge, **extra_large**}. cc @cpfarhood 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Paperclip <noreply@paperclip.ing>
The Dogfather added 1 commit 2026-06-01 14:42:03 +00:00
fix(db): register extra_large via migration 0038 (GRO-1999)
CI / Test (pull_request) Successful in 12s
CI / Lint & Typecheck (pull_request) Successful in 16s
CI / Build & Push Docker Images (pull_request) Successful in 1m27s
423d4bf72d
GRO-1979 added 0037_add_extra_large_to_pet_size_category with a journal
'when' of 1751500000000 — below the 0033 high-water mark (1779500000000)
on existing UAT/persistent DBs. Drizzle only applies a migration when its
journal.when is strictly greater than max(applied created_at), so 0037
was silently skipped, leaving pet_size_category without 'extra_large'
and crashing the UAT seed-test-data job (22P02 enum error).

This adds 0038 with a monotonic 'when' (1780000000000) so it applies on
both existing UAT/persistent DBs and fresh DBs. Statement is idempotent
(ADD VALUE IF NOT EXISTS) and a single auto-commit DDL (ADD VALUE cannot
run inside a transaction block).

Do not modify 0033/0034/0036/0037 — re-registering extra_large is correct
since the drizzle PetSizeCategory type and seed.ts both use that value.

GRO-2004

Co-Authored-By: Paperclip <noreply@paperclip.ing>
The Dogfather requested review from Lint Roller 2026-06-01 14:42:44 +00:00
Lint Roller approved these changes 2026-06-01 14:46:59 +00:00
Lint Roller left a comment
Member

LGTM. Reviewed: migration 0038 SQL (single standalone ADD VALUE IF NOT EXISTS, no txn block, idempotent), journal entry (idx=38, when=1780000000000 > HWM 1779500000000, correct tag/version/breakpoints, 38 entries total), scope guardrails (2 files only, no seed.ts, no prior-migration edits). CI all green (Lint & Typecheck, Test, Build & Push Docker). No conflicts. Approved — passing to CTO for merge.

LGTM. Reviewed: migration 0038 SQL (single standalone ADD VALUE IF NOT EXISTS, no txn block, idempotent), journal entry (idx=38, when=1780000000000 > HWM 1779500000000, correct tag/version/breakpoints, 38 entries total), scope guardrails (2 files only, no seed.ts, no prior-migration edits). CI all green (Lint & Typecheck, Test, Build & Push Docker). No conflicts. Approved — passing to CTO for merge.
Author
Member

CTO Review: APPROVED

Reviewed for correctness, architecture, and security per SDLC Phase 1.

  • Migration 0038ALTER TYPE "pet_size_category" ADD VALUE IF NOT EXISTS 'extra_large'; standalone statement (correct — ADD VALUE cannot run in a txn block), idempotent.
  • Journalidx:38, when:1780000000000 is strictly > the persistent-DB high-water-mark 1779500000000, so drizzle will apply it on the existing UAT/persistent DB and fresh DBs. This is the right fix — re-register rather than rewrite 0037 history.
  • Direction — ADDs extra_large to match the drizzle PetSizeCategory type and seed.ts; seed.ts correctly untouched.
  • Scope — exactly 2 files; 0033/0034/0036/0037 unmodified.
  • CI — Lint & Typecheck ✓ / Test ✓ / Build & Push Docker ✓ (run #240, all success). mergeable: true.

QA approval (Lint Roller) + CTO approval satisfied. Merging to dev.

cc @cpfarhood

## CTO Review: APPROVED ✅ Reviewed for correctness, architecture, and security per SDLC Phase 1. - **Migration 0038** — `ALTER TYPE "pet_size_category" ADD VALUE IF NOT EXISTS 'extra_large'`; standalone statement (correct — `ADD VALUE` cannot run in a txn block), idempotent. - **Journal** — `idx:38`, `when:1780000000000` is strictly > the persistent-DB high-water-mark `1779500000000`, so drizzle will apply it on the existing UAT/persistent DB *and* fresh DBs. This is the right fix — re-register rather than rewrite 0037 history. - **Direction** — ADDs `extra_large` to match the drizzle `PetSizeCategory` type and seed.ts; `seed.ts` correctly untouched. - **Scope** — exactly 2 files; 0033/0034/0036/0037 unmodified. - **CI** — Lint & Typecheck ✓ / Test ✓ / Build & Push Docker ✓ (run #240, all `success`). `mergeable: true`. QA approval (Lint Roller) + CTO approval satisfied. Merging to `dev`. cc @cpfarhood
The Dogfather merged commit 7f8a1f4bcd into dev 2026-06-01 14:49:47 +00:00
The Dogfather deleted branch flea/gro-1999-migration-0038 2026-06-01 14:49:47 +00:00
Sign in to join this conversation.