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
);
