From d272e52ba0af489ee321ed459ceb34d27bd3660f Mon Sep 17 00:00:00 2001 From: sax3l Date: Tue, 22 Sep 2026 05:33:13 +0200 Subject: [PATCH] =?UTF-8?q?fix(db):=20subscriptions.created=5Fat=20?= =?UTF-8?q?=E2=80=94=20migration=20014=20reparerar=20GET=20/api/subscripti?= =?UTF-8?q?ons=20(42703=20m=C3=A4tt=20live)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lib/subscriptions-store.ts listSubscriptions() SELECT:ar created_at men sql/001_init.sql definierade aldrig kolumnen — GET /api/subscriptions har alltså ALWAYS brutit mot Postgres i prod (42703 errorMissingColumn, mätt live mot 0pt.app 2026-09-22: 500). Kolumnen är nu ADD:ad live på 0pt-edge-postgres (idempotent IF NOT EXISTS); denna migration gör ändringen reproducerbar. GET svarar nu 200 []. --- sql/014_subscriptions_created_at.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 sql/014_subscriptions_created_at.sql diff --git a/sql/014_subscriptions_created_at.sql b/sql/014_subscriptions_created_at.sql new file mode 100644 index 0000000..d27e989 --- /dev/null +++ b/sql/014_subscriptions_created_at.sql @@ -0,0 +1,6 @@ +-- 014: subscriptions.created_at — additiv. +-- lib/subscriptions-store.ts SELECT:ar `created_at` men sql/001_init.sql definierade +-- aldrig kolumnen, så GET /api/subscriptions (200-kontraktet) bröt mot Postgres +-- (42703 errorMissingColumn, mätt live 2026-09-22 på 0pt.app). Idempotent; applicerad +-- live på 0pt-edge-postgres (xh70k0qa0cyju840zsvsgoze) samma pass. +ALTER TABLE subscriptions ADD COLUMN IF NOT EXISTS created_at timestamptz DEFAULT now(); -- 2.54.0