From 186b1c5adbad80f1e1eab29fb8b347fa0e71eadf Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 20 Jun 2019 00:23:53 +0200 Subject: [PATCH] initial schema --- schema/conf-prov.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 schema/conf-prov.sql diff --git a/schema/conf-prov.sql b/schema/conf-prov.sql new file mode 100644 index 0000000..c37204c --- /dev/null +++ b/schema/conf-prov.sql @@ -0,0 +1,19 @@ +-- Configuration and Provisioning Schema + +DROP TABLE tDatapoint; + +CREATE TABLE tDatapoint ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + unit INTEGER NOT NULL, + address INTEGER NOT NULL, + count INTEGER NOT NULL, + converter TEXT NOT NULL, + label TEXT NOT NULL, + scanRate INTEGER NOT NULL DEFAULT 1000, -- in milliseconds + lastContact TEXT, + lastError TEXT, + lastValue TEXT, + backoff INTEGER NOT NULL DEFAULT 0, -- in seconds + CONSTRAINT uniqueDatapoint UNIQUE (unit, address, count, label) +); +