diff --git a/script/sql/create/13.controls.sql b/script/sql/create/13.controls.sql index c5930ab..335db45 100644 --- a/script/sql/create/13.controls.sql +++ b/script/sql/create/13.controls.sql @@ -1,30 +1,6 @@ -- [CONTROLS] -create type controls_1_prep as enum ('above', 'below'); - --- LINK linkID status IF NODE nodeID ABOVE / BELOW value -create table controls_1 +create table controls ( - linkid varchar(32) primary key references _link(id) -, status text not null -- open / closed, a pump speed setting, or a control valve setting -, nodeid varchar(32) references _node(id) not null -, prep controls_1_prep not null -, value numeric not null -); - --- LINK linkID status AT TIME time -create table controls_2 -( - linkid varchar(32) primary key references _link(id) -, status text not null -- open / closed, a pump speed setting, or a control valve setting -, time interval hour -); - --- LINK linkID status AT CLOCKTIME clocktime AM / PM -create table controls_3 -( - linkid varchar(32) primary key references _link(id) -, status text not null -- open / closed, a pump speed setting, or a control valve setting -, clock_time_hour interval hour -- get am/pm from it -, clock_time_min interval minute + control text primary key ); diff --git a/script/sql/drop/13.controls.sql b/script/sql/drop/13.controls.sql index 6dd2eb8..b17cb69 100644 --- a/script/sql/drop/13.controls.sql +++ b/script/sql/drop/13.controls.sql @@ -1,9 +1,3 @@ -- [CONTROLS] -drop table if exists controls_3; - -drop table if exists controls_2; - -drop table if exists controls_1; - -drop type if exists controls_1_prep; +drop table if exists controls;