smon/sql/00001.sql

11 lines
360 B
MySQL
Raw Normal View History

2024-04-29 08:36:13 +02:00
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")
);