feat: store finding as structured title/fix/sources, not flat message
Migration 0002 replaces finding.message with title/fix/sources (a Postgres text[]). A finding needs to render into the dossier the way it looked at the moment it was raised — referencing the current rules/*.yaml by rule_id+version isn't safe once that file is edited for a later version, since old wording isn't kept around as a separate live file. Added as a new migration rather than editing 0001, since that's already applied on the test server. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
ALTER TABLE finding DROP COLUMN title;
|
||||
ALTER TABLE finding DROP COLUMN fix;
|
||||
ALTER TABLE finding DROP COLUMN sources;
|
||||
ALTER TABLE finding ADD COLUMN message TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE finding ALTER COLUMN message DROP DEFAULT;
|
||||
@@ -0,0 +1,11 @@
|
||||
-- finding.message war ein einzelnes Freitextfeld. Fürs Dossier brauchen
|
||||
-- wir Titel, Korrekturvorschlag und Fundstellen aber strukturiert und
|
||||
-- getrennt (siehe internal/dossier), sonst müsste die Anzeige Text
|
||||
-- wieder auseinanderparsen, den wir selbst zusammengefügt haben.
|
||||
ALTER TABLE finding DROP COLUMN message;
|
||||
ALTER TABLE finding ADD COLUMN title TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE finding ADD COLUMN fix TEXT NOT NULL DEFAULT '';
|
||||
ALTER TABLE finding ADD COLUMN sources TEXT[] NOT NULL DEFAULT '{}';
|
||||
ALTER TABLE finding ALTER COLUMN title DROP DEFAULT;
|
||||
ALTER TABLE finding ALTER COLUMN fix DROP DEFAULT;
|
||||
ALTER TABLE finding ALTER COLUMN sources DROP DEFAULT;
|
||||
Reference in New Issue
Block a user