CREATE TYPE datapoint_type AS ENUM('INT', 'STRING', 'DATETIME');

CREATE TABLE public.datapoint (
	"id"         serial NOT NULL,
	"name"       varchar NOT NULL,
	"datatype"   datapoint_type NOT NULL,
	"last_value" timestamptz DEFAULT '1970-01-01 00:00:00+00' NOT NULL,
	CONSTRAINT datapoint_pk PRIMARY KEY (id),
	CONSTRAINT datapoint_unique UNIQUE ("name")
);
