diff --git a/packages/db/migrations/0037_add_extra_large_to_pet_size_category.sql b/packages/db/migrations/0037_add_extra_large_to_pet_size_category.sql new file mode 100644 index 0000000..e7eac1a --- /dev/null +++ b/packages/db/migrations/0037_add_extra_large_to_pet_size_category.sql @@ -0,0 +1,19 @@ +-- Migration: 0037_add_extra_large_to_pet_size_category.sql +-- GRO-1979: Adds the 'extra_large' value to the pet_size_category enum. +-- +-- 0031_buffer_rules.sql created pet_size_category with values +-- ('small', 'medium', 'large', 'xlarge'), but seed.ts and the drizzle +-- schema (PetSizeCategory type) both use 'extra_large' — a mismatch that +-- caused the UAT seed job to fail with: +-- invalid input value for enum pet_size_category: "extra_large" +-- +-- 0035/0036 (GRO-1971) registered 'short'/'medium'/'silky' in coat_type. +-- This migration is the pet_size_category counterpart: register +-- 'extra_large' so seed.ts can write the value the schema declares. +-- +-- Postgres restriction: ALTER TYPE ADD VALUE cannot run inside a +-- transaction block. The drizzle migrate runner does not wrap +-- individual statements in an explicit transaction, so this applies +-- as a single auto-commit DDL. + +ALTER TYPE "pet_size_category" ADD VALUE IF NOT EXISTS 'extra_large'; diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index 1c7c56a..5ae5432 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -253,6 +253,13 @@ "when": 1751480000000, "tag": "0036_add_missing_coat_type_values", "breakpoints": true + }, + { + "idx": 37, + "version": "7", + "when": 1751500000000, + "tag": "0037_add_extra_large_to_pet_size_category", + "breakpoints": true } ] } \ No newline at end of file