smon/sql/00005.sql
2024-04-29 08:36:13 +02:00

12 lines
343 B
SQL

CREATE TABLE public.trigger (
id serial NOT NULL,
name varchar NOT NULL,
section_id int4 NOT NULL,
expression varchar NOT NULL,
datapoints jsonb NOT NULL DEFAULT '[]',
CONSTRAINT trigger_pk PRIMARY KEY (id),
CONSTRAINT trigger_section_fk FOREIGN KEY (section_id) REFERENCES public.section(id) ON DELETE RESTRICT ON UPDATE RESTRICT
);