From 2fee69b61cef844048fa0bdf730412c9153f2f08 Mon Sep 17 00:00:00 2001 From: Flea Flicker Date: Mon, 1 Jun 2026 00:42:05 +0000 Subject: [PATCH] =?UTF-8?q?feat(db):=20add=200035=5Fextend=5Fpet=5Fenums?= =?UTF-8?q?=20=E2=80=94=20adds=20missing=20coat=5Ftype=20(short/medium/sil?= =?UTF-8?q?ky)=20and=20pet=5Fsize=5Fcategory=20(extra=5Flarge)=20values?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GRO-1979: The coat_type and pet_size_category enums were captured in the schema snapshot (0034_extend_pet_profile_columns) with their full value sets, but the SQL migration 0034 only added new columns and never ran ALTER TYPE ADD VALUE. The drizzle journal therefore had no entry for these enum extensions, so they were never applied to UAT. This new migration (0035) runs the ALTER TYPE ADD VALUE statements (non-transactional per Postgres restriction) to register short, medium, and silky in coat_type, and extra_large in pet_size_category. The journal is also updated to include idx 35 for this migration. Co-Authored-By: Paperclip --- .../db/migrations/0035_extend_pet_enums.sql | 18 ++++++++++++++++++ packages/db/migrations/meta/_journal.json | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 packages/db/migrations/0035_extend_pet_enums.sql diff --git a/packages/db/migrations/0035_extend_pet_enums.sql b/packages/db/migrations/0035_extend_pet_enums.sql new file mode 100644 index 0000000..97810da --- /dev/null +++ b/packages/db/migrations/0035_extend_pet_enums.sql @@ -0,0 +1,18 @@ +-- Migration: 0035_extend_pet_enums.sql +-- GRO-1979: Adds missing enum values for coat_type (short/medium/silky) and +-- pet_size_category (extra_large) that were captured in schema snapshots but +-- never applied to the DB because 0034 did not include ALTER TYPE ADD VALUE. + +-- Postgres restriction: ALTER TYPE ADD VALUE cannot run inside a transaction block. +-- We deliberately do NOT wrap this in BEGIN...COMMIT so drizzle can apply it +-- as a standalone statement outside any implicit transaction. + +-- ─── Extend coat_type enum ──────────────────────────────────────────────── + +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'; + +-- ─── Extend pet_size_category enum ──────────────────────────────────────── + +ALTER TYPE "pet_size_category" ADD VALUE IF NOT EXISTS 'extra_large'; \ No newline at end of file diff --git a/packages/db/migrations/meta/_journal.json b/packages/db/migrations/meta/_journal.json index db9e36c..983be25 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": 1751300000000, + "tag": "0035_extend_pet_enums", + "breakpoints": true } ] } \ No newline at end of file