Some checks are pending
CI / validate (push) Waiting to run
Production-DB hatte cards.decks.archived_at nicht, obwohl 0000_baseline die Spalte im CREATE TABLE hat. Ursache: Schema-Datei wurde nach initialer DB-Provisionierung um archived_at erweitert, ohne separate ADD-COLUMN-Migration zu generieren. Resultat: cards-native DeckListView triggert GET /api/v1/decks → isNull(decks.archivedAt) → PostgresError → HTTP 500. Fix: - 0002_decks_archived_at.sql mit ALTER TABLE IF NOT EXISTS (idempotent) - _journal.json updaten - Auf Production manuell schon angewandt 2026-05-13 — diese Migration ist nur für fresh Setups + Migration-State-Konsistenz Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
13 lines
663 B
SQL
13 lines
663 B
SQL
-- Add `archived_at` to cards.decks.
|
|
--
|
|
-- Hintergrund: 0000_baseline.sql hat die Spalte zwar im CREATE TABLE,
|
|
-- aber die Production-DB wurde damals noch vor dem archived_at-Add
|
|
-- aufgespielt, sodass die echte Tabelle bis 2026-05-13 keine
|
|
-- archived_at-Spalte hatte. cards-native's DeckListView triggert
|
|
-- GET /api/v1/decks, der Hono-Handler fragt `isNull(decks.archivedAt)`
|
|
-- ab → Postgres-Error "column does not exist" → HTTP 500.
|
|
--
|
|
-- Idempotent (`IF NOT EXISTS`), damit fresh Setups (wo die Spalte
|
|
-- via Baseline schon da ist) den Schritt überspringen.
|
|
|
|
ALTER TABLE "cards"."decks" ADD COLUMN IF NOT EXISTS "archived_at" timestamp with time zone;
|