From 8637dc0f576b5229b99ef8eb9ae14291210f031f Mon Sep 17 00:00:00 2001 From: Wolfgang Ludger Hottgenroth Date: Tue, 11 Jan 2022 10:30:09 +0100 Subject: [PATCH] document alarm and mainscnt --- schema/createSchema.sql | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/schema/createSchema.sql b/schema/createSchema.sql index d7ad610..4bf1991 100644 --- a/schema/createSchema.sql +++ b/schema/createSchema.sql @@ -7,3 +7,23 @@ CREATE TABLE device_t ( location varchar(128) NOT NULL, active boolean NOT NULL DEFAULT false ); + +CREATE SEQUENCE alarm_event_s START WITH 1 INCREMENT BY 1; + +CREATE TABLE alarm_event_t ( + id integer PRIMARY KEY DEFAULT NEXTVAL('alarm_event_s'), + time timestamp without time zone NOT NULL DEFAULT now(), + status varchar(32) NOT NULL, + info varchar(256) NOT NULL, + name varchar(32) NOT NULL +); + +CREATE TABLE mainsfrequency ( + time timestamp without time zone NOT NULL, + host text, + location text, + freq double precision, + valid smallint NOT NULL DEFAULT 1 +); + +SELECT create_hypertable('mainsfrequency', 'time');