From 707e74e6e1d778d49f4f4055151d8c0f2fb5bace 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 | 4 ++-- 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 packages/db/migrations/0035_add_missing_coat_type_values.sql diff --git a/UAT_PLAYBOOK.md b/UAT_PLAYBOOK.md index a458219..3b6ed03 100644 --- a/UAT_PLAYBOOK.md +++ b/UAT_PLAYBOOK.md @@ -116,6 +116,7 @@ GroomBook API is a Hono-based REST service (TypeScript/Node.js) powering the pet | 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 30+ total pets in UAT DB | GET /api/pets then count total | 30+ pets returned (UAT seed creates 500 random-pool + 5 UAT test clients + 2 UAT customer = 507 total) | | TC-API-3.26 | Verify 25-35% medicalAlerts distribution | GET /api/pets (first 30 pets), count how many have non-empty medicalAlerts | Ratio is 25-35% (seed uses rand() < 0.3 for ~30% distribution) | +| TC-API-3.27 | 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 58d27a7..5009d34 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -250,8 +250,8 @@ { "idx": 35, "version": "7", - "when": 1751140800000, - "tag": "0035_add_short_to_coat_type_enum", + "when": 1751480000000, + "tag": "0035_add_missing_coat_type_values", "breakpoints": true } ]