From ff1de7f77df2d9f5554c3668cb411b289fd0f9bb Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Sun, 31 May 2026 23:05:36 +0000 Subject: [PATCH] fix: add missing 'short'/'medium'/'silky' to coat_type enum (GRO-1971) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Migration 0031_buffer_rules.sql created coat_type enum with values ('smooth', 'double', 'wire', 'curly', 'long', 'hairless') but omitted 'short', 'medium', and 'silky' which are defined in schema.ts and required by seed.ts. Added 0035_add_missing_coat_type_values.sql to add the missing values using ALTER TYPE ... ADD VALUE IF NOT EXISTS. This resolves the UAT seed failure: PostgresError: invalid input value for enum coat_type: "short" code: '22P02' routine: 'enum_in' (packages/db/src/seed.ts) Dev→UAT SDLC: QA (Lint Roller) review, then CTO review. Co-Authored-By: Paperclip --- UAT_PLAYBOOK.md | 1 + .../db/migrations/0035_add_missing_coat_type_values.sql | 9 +++++++++ packages/db/migrations/meta/_journal.json | 7 +++++++ 3 files changed, 17 insertions(+) create mode 100644 packages/db/migrations/0035_add_missing_coat_type_values.sql diff --git a/UAT_PLAYBOOK.md b/UAT_PLAYBOOK.md index 2cb3bab..1f16437 100644 --- a/UAT_PLAYBOOK.md +++ b/UAT_PLAYBOOK.md @@ -114,6 +114,7 @@ GroomBook API is a Hono-based REST service (TypeScript/Node.js) powering the pet | TC-API-3.22 | Verify medicalAlerts shape | GET /api/pets/{id} for any pet with non-empty medicalAlerts | medicalAlerts is an array; each entry has type, description, severity | | TC-API-3.23 | Verify UAT test pet Charlie has behavioral alert | GET /api/pets/{id} where name = "TestCooper" (pet for uat-charlie@groombook.dev) | medicalAlerts includes an entry with type: "behavioral", severity: "low" or "high" | | TC-API-3.24 | Verify UAT test pet Delta has skin alert | GET /api/pets/{id} where name = "TestRocky" (pet for uat-delta@groombook.dev) | medicalAlerts includes an entry with type: "skin" | +| TC-API-3.25 | Verify coat_type enum has all seed values | After UAT seed completes, inspect the coat_type enum on the UAT DB — it must contain: short, medium, long, double, wire, silky, curly, hairless | UAT seed jobs (`reset-demo-data`, `seed-test-data`) complete 1/1 with no `enum_in` error; coat_type includes all 8 values used by seed.ts `coatTypePool` | ### 4.4 Appointment Scheduling diff --git a/packages/db/migrations/0035_add_missing_coat_type_values.sql b/packages/db/migrations/0035_add_missing_coat_type_values.sql new file mode 100644 index 0000000..3b7a2d3 --- /dev/null +++ b/packages/db/migrations/0035_add_missing_coat_type_values.sql @@ -0,0 +1,9 @@ +-- Migration: 0035_add_missing_coat_type_values.sql +-- Adds missing values to coat_type enum that seed.ts requires but which were +-- omitted from the 0031_buffer_rules.sql CREATE TYPE statement (migration drift). +-- 0031 created: 'smooth', 'double', 'wire', 'curly', 'long', 'hairless' +-- Missing (from schema.ts coatTypeEnum): 'short', 'medium', 'silky' + +ALTER TYPE "coat_type" ADD VALUE IF NOT EXISTS 'short'; +ALTER TYPE "coat_type" ADD VALUE IF NOT EXISTS 'medium'; +ALTER TYPE "coat_type" ADD VALUE IF NOT EXISTS 'silky'; \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index db9e36c..5009d34 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -246,6 +246,13 @@ "when": 1751140800000, "tag": "0034_extend_pet_profile_columns", "breakpoints": true + }, + { + "idx": 35, + "version": "7", + "when": 1751480000000, + "tag": "0035_add_missing_coat_type_values", + "breakpoints": true } ] } \ No newline at end of file