diff --git a/Dockerfile b/Dockerfile index b9d73bf..5fea669 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,10 @@ FROM node:22-alpine AS base -RUN corepack enable && corepack install -g pnpm@9.15.4 -ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 -ENV COREPACK_ENABLE_STRICT=0 +# Install pnpm as a real binary via npm (not corepack shim) so runtime +# invocations of `pnpm` work without DNS access to registry.npmjs.org. +# The corepack shim delegates to corepack, which re-validates against +# npmjs.org on first use — that fails in air-gapped UAT seed/migrate/reset +# Jobs. GRO-1983 / GRO-1889 / GRO-1909. +RUN npm install -g pnpm@9.15.4 WORKDIR /app # Install deps @@ -22,9 +25,7 @@ RUN pnpm --filter @groombook/types build && \ # Runtime FROM node:22-alpine AS runner -RUN corepack enable && corepack install -g pnpm@9.15.4 -ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 -ENV COREPACK_ENABLE_STRICT=0 +RUN npm install -g pnpm@9.15.4 WORKDIR /app ENV NODE_ENV=production @@ -53,7 +54,4 @@ CMD ["pnpm", "--filter", "@groombook/db", "seed"] # Reset stage — drops all tables, re-runs migrations, and re-seeds FROM builder AS reset -RUN corepack enable && corepack install -g pnpm@9.15.4 -ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0 -ENV COREPACK_ENABLE_STRICT=0 CMD ["pnpm", "--filter", "@groombook/db", "reset"] 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..bf6fd92 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 +}