From 94f7c3d680f404bb10ac11e0772d3d62a3808989 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Fri, 8 May 2026 14:11:32 +0200 Subject: [PATCH] fix(db): backfill the users.locale column as a migration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `users.locale` has been on `schema.prisma` since the v1.3 locale-aware reminder work but never landed in the migration history — the column was applied via `prisma db push` to dev/prod and not committed as a migration. The drift is invisible against any environment that was ever pushed to, and only surfaces when a fresh database is built strictly from `prisma/migrations/` (CI integration test containers, brand-new self-host installs from a tagged image, etc.) — Postgres then reports `column users.locale does not exist` the first time the Prisma client touches the column. The migration is `ADD COLUMN IF NOT EXISTS`, so it's a clean add on a fresh database and a safe no-op against any environment that was already pushed-to. --- .../0025_user_locale_drift_fix/migration.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 prisma/migrations/0025_user_locale_drift_fix/migration.sql diff --git a/prisma/migrations/0025_user_locale_drift_fix/migration.sql b/prisma/migrations/0025_user_locale_drift_fix/migration.sql new file mode 100644 index 00000000..4b849fc5 --- /dev/null +++ b/prisma/migrations/0025_user_locale_drift_fix/migration.sql @@ -0,0 +1,14 @@ +-- 0025_user_locale_drift_fix +-- The `users.locale` column has been on `prisma/schema.prisma` since the +-- locale-aware reminder work in v1.3 but never landed in the migration +-- history (it must have been applied via `prisma db push` to dev / prod +-- but not committed as a migration). The schema drift is invisible until +-- a fresh database is built from migrations alone — at which point the +-- Prisma client tries to read `users.locale` and Postgres reports +-- `column users.locale does not exist`. +-- +-- This migration backfills the column with `IF NOT EXISTS` so it is a +-- safe no-op against any database that was kept in sync via `db push`, +-- and a clean add against any environment built strictly from this +-- migrations directory (CI test containers, fresh deploys, etc.). +ALTER TABLE "users" ADD COLUMN IF NOT EXISTS "locale" TEXT;