From 1520847813a054218fae2a545fab65252194fa94 Mon Sep 17 00:00:00 2001 From: "WQY\\qiong" Date: Fri, 10 Feb 2023 00:46:16 +0800 Subject: [PATCH] Add table scada_model --- script/sql/create/29.scada_model.sql | 13 +++++++++++++ script/sql/drop/29.scada_model.sql | 3 +++ 2 files changed, 16 insertions(+) create mode 100644 script/sql/create/29.scada_model.sql create mode 100644 script/sql/drop/29.scada_model.sql diff --git a/script/sql/create/29.scada_model.sql b/script/sql/create/29.scada_model.sql new file mode 100644 index 0000000..397683d --- /dev/null +++ b/script/sql/create/29.scada_model.sql @@ -0,0 +1,13 @@ +create type scada_type as enum ('PRESSURE', 'DEMAND', 'QUALITY', 'LEVEL', 'FLOW'); + +create table scada_model +( + id text primary key +, x numeric not null +, y numeric not null +, device_id text not null unique +, device_name text +, address text +, type scada_type +, model_id varchar(32) -- add constraint in API +); diff --git a/script/sql/drop/29.scada_model.sql b/script/sql/drop/29.scada_model.sql new file mode 100644 index 0000000..262077a --- /dev/null +++ b/script/sql/drop/29.scada_model.sql @@ -0,0 +1,3 @@ +drop table if exists scada_model; + +drop type if exists scada_type;