smon/sql/00022.sql
2024-07-04 09:21:46 +02:00

5 lines
363 B
SQL

ALTER TABLE public.problem ALTER COLUMN trigger_id DROP NOT NULL;
ALTER TABLE public.problem ADD COLUMN datapoints JSONB NOT NULL DEFAULT '{}';
ALTER TABLE public.problem DROP CONSTRAINT problem_trigger_fk;
ALTER TABLE public.problem ADD CONSTRAINT problem_trigger_fk FOREIGN KEY (trigger_id) REFERENCES public."trigger"(id) ON DELETE SET NULL ON UPDATE CASCADE;