From 423d4bf72d590091cdecdf00fe6064432c3abc11 Mon Sep 17 00:00:00 2001 From: Paperclip Date: Mon, 1 Jun 2026 14:41:18 +0000 Subject: [PATCH] fix(db): register extra_large via migration 0038 (GRO-1999) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GRO-1979 added 0037_add_extra_large_to_pet_size_category with a journal 'when' of 1751500000000 — below the 0033 high-water mark (1779500000000) on existing UAT/persistent DBs. Drizzle only applies a migration when its journal.when is strictly greater than max(applied created_at), so 0037 was silently skipped, leaving pet_size_category without 'extra_large' and crashing the UAT seed-test-data job (22P02 enum error). This adds 0038 with a monotonic 'when' (1780000000000) so it applies on both existing UAT/persistent DBs and fresh DBs. Statement is idempotent (ADD VALUE IF NOT EXISTS) and a single auto-commit DDL (ADD VALUE cannot run inside a transaction block). Do not modify 0033/0034/0036/0037 — re-registering extra_large is correct since the drizzle PetSizeCategory type and seed.ts both use that value. GRO-2004 Co-Authored-By: Paperclip --- .../0038_register_extra_large_pet_size_category.sql | 4 ++++ packages/db/migrations/meta/_journal.json | 7 +++++++ 2 files changed, 11 insertions(+) create mode 100644 packages/db/migrations/0038_register_extra_large_pet_size_category.sql diff --git a/packages/db/migrations/0038_register_extra_large_pet_size_category.sql b/packages/db/migrations/0038_register_extra_large_pet_size_category.sql new file mode 100644 index 0000000..e80fe7f --- /dev/null +++ b/packages/db/migrations/0038_register_extra_large_pet_size_category.sql @@ -0,0 +1,4 @@ +-- GRO-1999: 0037 was skipped on existing DBs due to a below-high-water-mark +-- journal timestamp. Re-register extra_large with a monotonic timestamp so +-- the existing UAT/persistent DBs apply it. Idempotent. +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 bf6fd92..0645748 100644 --- a/packages/db/migrations/meta/_journal.json +++ b/packages/db/migrations/meta/_journal.json @@ -260,6 +260,13 @@ "when": 1751500000000, "tag": "0037_add_extra_large_to_pet_size_category", "breakpoints": true + }, + { + "idx": 38, + "version": "7", + "when": 1780000000000, + "tag": "0038_register_extra_large_pet_size_category", + "breakpoints": true } ] }