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

11 lines
401 B
SQL

CREATE TABLE public.datapoint_value (
id serial8 NOT NULL,
datapoint_id int4 NOT NULL,
ts timestamptz DEFAULT NOW() NOT NULL,
value_int int8 NULL,
value_string varchar NULL,
value_datetime timestamptz NULL,
CONSTRAINT datapoint_value_pk PRIMARY KEY (id),
CONSTRAINT datapoint_value_datapoint_fk FOREIGN KEY (datapoint_id) REFERENCES public.datapoint(id) ON DELETE CASCADE ON UPDATE CASCADE
);