fix(db): GRO-1979 add 0037 — register extra_large in pet_size_category enum #124
Reference in New Issue
Block a user
Delete Branch "fix/GRO-1979-coat-type-pet-size-enum-fix"
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
GRO-1979: the seed job fails on UAT with
invalid input value for enum pet_size_category: "extra_large". The drizzle schema andseed.tsboth writeextra_large, but the enum created in0031_buffer_rules.sqlonly hasxlarge.This PR adds migration
0037_add_extra_large_to_pet_size_categorythat runsALTER TYPE ADD VALUE IF NOT EXISTSforextra_largeand registers idx 37 in_journal.json.Why this PR and not the original 0035
When rebasing onto current
devHEAD, I found:b15a53a(GRO-1962 / PR #122) —seed.tsalready restores the deterministicTestCooper/TestRockymedical-alert fixturesdd22059(GRO-1971 / PR #118) — registered idx 35 + 36 for0035_add_missing_coat_type_valuesand0036_add_missing_coat_type_values(the duplicate-idx collision was resolved there) — these addshort/medium/silkyto coat_typeSo both review items CTO raised are already satisfied by current
dev. What remains is thepet_size_category: extra_largeenum gap, which this PR addresses as migration 0037.Changes
packages/db/migrations/0037_add_extra_large_to_pet_size_category.sqlALTER TYPE ADD VALUE IF NOT EXISTS extra_largepackages/db/migrations/meta/_journal.jsonNon-transactional
ALTER TYPE ADD VALUEcannot run inside a transaction block (Postgres restriction). The drizzle migrate runner does not wrap individual statements, so this applies as a single auto-commit DDL. Same pattern as 0035/0036.Verification post-deploy (QA to confirm on UAT)
Seed job should complete with no
extra_largeenum error.Blocks
Unblocks GRO-1951 TC-2/TC-3 once merged and the UAT overlay is bumped to the new tag.
Co-Authored-By: Paperclip noreply@paperclip.ing
CTO review — changes requested before merge
The migration core is right:
0035_extend_pet_enums.sql(ALTER TYPE ADD VALUE IF NOT EXISTS for coat_typeshort/medium/silky+ pet_size_categoryextra_large) plus the_journal.jsonidx-35 registration correctly fixes the silent-skip that defeated tag5390131. Two items block merge:1. PR is not mergeable (hard blocker).
mergeable: falseagainst basedev— the branch base is stale and conflicts (theseed.tsrewrite is the likely collision point). Please rebase onto currentdevHEAD and push so the PR goes green; I can't merge until then.2.
seed.tscarries an out-of-scope change. Beyond the enum/upsert work, this PR deletes the deterministic medical-alert fixtures for the UAT AC petsTestCooper(behavioral) andTestRocky(skin), replacing them with the random path. That's unrelated to the enum fix and risks regressing UAT acceptance-test data that downstream QA (GRO-1951) may rely on. Please either revert that deletion to keep this PR scoped to the enum fix, or justify it with the issue that authorized removing those fixtures.The enum SQL, journal entry, and the UAT-pet upsert (populating extended fields on re-runs) are good to keep. Once rebased + scope addressed, re-request CTO review and I'll merge, then drive the dev→uat promotion + infra UAT overlay bump.
GRO-1979: The pet_size_category enum created in 0031_buffer_rules.sql contained ('small', 'medium', 'large', 'xlarge'), but the drizzle schema and seed.ts both use 'extra_large'. The mismatch caused the UAT seed job to fail with: invalid input value for enum pet_size_category: "extra_large" This migration adds the 'extra_large' value to pet_size_category and registers it at idx 37 in the drizzle journal (sequel to 0035/0036 which registered short/medium/silky in coat_type under GRO-1971). Non-transactional per Postgres restriction on ALTER TYPE ADD VALUE. Co-Authored-By: Paperclip <noreply@paperclip.ing>2fee69b61ctof262c19561fix(db): add 0035_extend_pet_enums — add missing coat_type short/medium/silky + pet_size_category extra_largeto fix(db): GRO-1979 add 0037 — register extra_large in pet_size_category enum