Files
paliad/internal/db/migrations/034_deadlines_rule_code.up.sql
m 53f7eae665 fix(t-paliad-111): renumber colliding migration 032→034 — production was down
Two migrations both named 032 collided when t-111 and t-112 merged in
parallel — 032_deadline_notes_en (t-112, already applied to the DB and
tracker bumped to v33) vs. 032_deadlines_rule_code (t-111). The Go
migration runner refuses to init the driver when two files share a
prefix, so paliad.de was 404 across all routes (container in restart
loop with `migration failed: ... duplicate migration file:
032_deadlines_rule_code.down.sql`).

Renumbering t-111's pair to 034 (033 was used by t-112's
trigger_events_de backfill).
2026-05-04 14:57:54 +02:00

22 lines
1.1 KiB
SQL

-- t-paliad-111 B6: store the legal rule citation (RoP.023, R.151, …) on
-- the Deadline row directly so the /deadlines list and project-detail
-- /deadlines tab can render REGEL without having to JOIN paliad.deadline_rules.
--
-- Before: the Fristenrechner save flow concatenated the rule code into
-- the title ("RoP.023 — Klageerwiderung") because deadlines had nowhere
-- else to put it; the REGEL column ended up showing "—" because rule_id
-- on the bulk-save payload is always NULL (no rule UUID round-trips
-- through the public Fristenrechner API).
--
-- After: the save flow sends rule_code as a plain string field, the
-- title stays clean ("Klageerwiderung"), and the list join becomes
-- redundant — the deadline owns its citation.
ALTER TABLE paliad.deadlines
ADD COLUMN IF NOT EXISTS rule_code text;
COMMENT ON COLUMN paliad.deadlines.rule_code IS
'Legal rule citation (e.g. "RoP.023") as it should appear in REGEL. '
'Free text — not FK-constrained — so the value survives rule-table '
'rewrites and accepts citations from sources outside paliad.deadline_rules.';