Format sql

This commit is contained in:
WQY\qiong
2022-10-09 11:06:19 +08:00
parent d99c0eacbf
commit 9accb467b2
58 changed files with 283 additions and 283 deletions

View File

@@ -1,25 +1,25 @@
CREATE TYPE _NODE_TYPE AS ENUM ('junction', 'reservoir', 'tank'); create type _node_type as enum ('junction', 'reservoir', 'tank');
CREATE TYPE _LINK_TYPE AS ENUM ('pipe', 'pump', 'valve'); create type _link_type as enum ('pipe', 'pump', 'valve');
CREATE TABLE _NODE create table _node
( (
ID VARCHAR(32) PRIMARY KEY id varchar(32) primary key
, Type _NODE_TYPE NOT NULL , type _node_type not null
); );
CREATE TABLE _LINK create table _link
( (
ID VARCHAR(32) PRIMARY KEY id varchar(32) primary key
, Type _LINK_TYPE NOT NULL , type _link_type not null
); );
CREATE TABLE _CURVE create table _curve
( (
ID VARCHAR(32) PRIMARY KEY id varchar(32) primary key
); );
CREATE TABLE _PATTERN create table _pattern
( (
ID VARCHAR(32) PRIMARY KEY id varchar(32) primary key
); );

View File

@@ -1,8 +1,8 @@
-- [TITLE] -- [TITLE]
CREATE TABLE TITLE create table title
( (
Value TEXT value text
); );
INSERT INTO TITLE (Value) VALUES (''); insert into title (value) values ('');

View File

@@ -1,29 +1,29 @@
-- [STATUS] -- [STATUS]
CREATE TYPE STATUS_PIPE_PUMP_STATUS AS ENUM ('OPEN', 'CLOSED'); create type status_pipe_pump_status as enum ('open', 'closed');
CREATE TABLE STATUS_PIPE create table status_pipe
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES PIPES(ID) id varchar(32) primary key references pipes(id)
, Status STATUS_PIPE_PUMP_STATUS NOT NULL , status status_pipe_pump_status not null
); );
CREATE TABLE STATUS_PUMP create table status_pump
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES PUMPS(ID) id varchar(32) primary key references pumps(id)
, Status STATUS_PIPE_PUMP_STATUS NOT NULL , status status_pipe_pump_status not null
); );
CREATE TYPE STATUS_VALVE_STATUS AS ENUM ('OPEN', 'CLOSED', 'ACTIVE'); create type status_valve_status as enum ('open', 'closed', 'active');
CREATE TABLE STATUS_VALVE create table status_valve
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES VALVES(ID) id varchar(32) primary key references valves(id)
, Status STATUS_VALVE_STATUS NOT NULL , status status_valve_status not null
); );
CREATE TABLE STATUS_LINK create table status_link
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) id varchar(32) primary key references _link(id)
, Setting NUMERIC NOT NULL , setting numeric not null
); );

View File

@@ -1,7 +1,7 @@
-- [PATTERNS] -- [PATTERNS]
CREATE TABLE PATTERNS create table patterns
( (
ID VARCHAR(32) REFERENCES _PATTERN(ID) NOT NULL id varchar(32) references _pattern(id) not null
, Multipliers NUMERIC NOT NULL , multipliers numeric not null
); );

View File

@@ -1,8 +1,8 @@
-- [CURVES] -- [CURVES]
CREATE TABLE CURVES create table curves
( (
ID VARCHAR(32) REFERENCES _CURVE(ID) NOT NULL id varchar(32) references _curve(id) not null
, X NUMERIC NOT NULL , x numeric not null
, Y NUMERIC NOT NULL , y numeric not null
); );

View File

@@ -1,30 +1,30 @@
-- [CONTROLS] -- [CONTROLS]
CREATE TYPE CONTROLS_1_PREP AS ENUM ('ABOVE', 'BELOW'); create type controls_1_prep as enum ('above', 'below');
-- LINK linkID status IF NODE nodeID ABOVE / BELOW value -- LINK linkID status IF NODE nodeID ABOVE / BELOW value
CREATE TABLE CONTROLS_1 create table controls_1
( (
LinkID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) linkid varchar(32) primary key references _link(id)
, Status TEXT NOT NULL -- OPEN / CLOSED, a pump speed setting, or a control valve setting , status text not null -- open / closed, a pump speed setting, or a control valve setting
, NodeID VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , nodeid varchar(32) references _node(id) not null
, Prep CONTROLS_1_PREP NOT NULL , prep controls_1_prep not null
, Value NUMERIC NOT NULL , value numeric not null
); );
-- LINK linkID status AT TIME time -- LINK linkID status AT TIME time
CREATE TABLE CONTROLS_2 create table controls_2
( (
LinkID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) linkid varchar(32) primary key references _link(id)
, Status TEXT NOT NULL -- OPEN / CLOSED, a pump speed setting, or a control valve setting , status text not null -- open / closed, a pump speed setting, or a control valve setting
, Time INTERVAL HOUR , time interval hour
); );
-- LINK linkID status AT CLOCKTIME clocktime AM / PM -- LINK linkID status AT CLOCKTIME clocktime AM / PM
CREATE TABLE CONTROLS_3 create table controls_3
( (
LinkID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) linkid varchar(32) primary key references _link(id)
, Status TEXT NOT NULL -- OPEN / CLOSED, a pump speed setting, or a control valve setting , 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_hour interval hour -- get am/pm from it
, Clock_Time_Min INTERVAL MINUTE , clock_time_min interval minute
); );

View File

@@ -1,6 +1,6 @@
-- [RULES] -- [RULES]
CREATE TABLE RULES create table rules
( (
Content TEXT PRIMARY KEY content text primary key
); );

View File

@@ -1,24 +1,24 @@
-- [ENERGY] -- [ENERGY]
CREATE TYPE ENERGY_PARAM AS ENUM ('PRICE', 'PATTERN', 'EFFIC'); create type energy_param as enum ('price', 'pattern', 'effic');
-- GLOBAL PRICE / PATTERN / EFFIC value -- GLOBAL PRICE / PATTERN / EFFIC value
CREATE TABLE ENERGY_GLOBAL create table energy_global
( (
Param ENERGY_PARAM NOT NULL param energy_param not null
, Value NUMERIC NOT NULL , value numeric not null
); );
-- PUMP pumpID PRICE / PATTERN / EFFIC value -- PUMP pumpID PRICE / PATTERN / EFFIC value
CREATE TABLE ENERGY_PUMP create table energy_pump
( (
ID VARCHAR(32) REFERENCES PUMPS(ID) NOT NULL id varchar(32) references pumps(id) not null
, Param ENERGY_PARAM NOT NULL , param energy_param not null
, Value NUMERIC NOT NULL , value numeric not null
); );
-- DEMAND CHARGE value -- DEMAND CHARGE value
CREATE TABLE ENERGY_DEMAND_CHARGE create table energy_demand_charge
( (
Value NUMERIC NOT NULL value numeric not null
); );

View File

@@ -1,7 +1,7 @@
-- [EMITTERS] -- [EMITTERS]
CREATE TABLE EMITTERS create table emitters
( (
Junction VARCHAR(32) PRIMARY KEY REFERENCES JUNCTIONS(ID) junction varchar(32) primary key references junctions(id)
, Coefficient NUMERIC NOT NULL , coefficient numeric not null
); );

View File

@@ -1,7 +1,7 @@
-- [QUALITY] -- [QUALITY]
CREATE TABLE QUALITY create table quality
( (
Node VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) node varchar(32) primary key references _node(id)
, InitialQual NUMERIC NOT NULL , initialqual numeric not null
); );

View File

@@ -1,11 +1,11 @@
-- [SOURCES] -- [SOURCES]
CREATE TYPE SOURCES_TYPE AS ENUM ('CONCEN', 'MASS', 'FLOWPACED', 'SETPOINT'); create type sources_type as enum ('concen', 'mass', 'flowpaced', 'setpoint');
CREATE TABLE SOURCES create table sources
( (
Node VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) node varchar(32) primary key references _node(id)
, Type SOURCES_TYPE NOT NULL , type sources_type not null
, Strength NUMERIC NOT NULL , strength numeric not null
, Time_Pattern VARCHAR(32) REFERENCES _PATTERN(ID) , time_pattern varchar(32) references _pattern(id)
); );

View File

@@ -1,42 +1,42 @@
-- [REACTIONS] -- [REACTIONS]
CREATE TYPE REACTIONS_ORDER_PARAM AS ENUM ('BULK', 'WALL', 'TANK'); create type reactions_order_param as enum ('bulk', 'wall', 'tank');
CREATE TABLE REACTIONS_ORDER create table reactions_order
( (
Key REACTIONS_ORDER_PARAM NOT NULL key reactions_order_param not null
, Value NUMERIC NOT NULL , value numeric not null
); );
CREATE TYPE REACTIONS_GLOBAL_PARAM AS ENUM ('BULK', 'WALL'); create type reactions_global_param as enum ('bulk', 'wall');
CREATE TABLE REACTIONS_GLOBAL create table reactions_global
( (
Key REACTIONS_GLOBAL_PARAM NOT NULL key reactions_global_param not null
, Value NUMERIC NOT NULL , value numeric not null
); );
CREATE TYPE REACTIONS_PIPE_PARAM AS ENUM ('BULK', 'WALL'); create type reactions_pipe_param as enum ('bulk', 'wall');
CREATE TABLE REACTIONS_PIPE create table reactions_pipe
( (
Key REACTIONS_PIPE_PARAM NOT NULL key reactions_pipe_param not null
, Pipe VARCHAR(32) REFERENCES PIPES(ID) NOT NULL , pipe varchar(32) references pipes(id) not null
, Value NUMERIC NOT NULL , value numeric not null
); );
CREATE TABLE REACTIONS_TANK create table reactions_tank
( (
Tank VARCHAR(32) REFERENCES TANKS(ID) NOT NULL tank varchar(32) references tanks(id) not null
, Value NUMERIC NOT NULL , value numeric not null
); );
CREATE TABLE REACTIONS_LIMITING_POTENTIAL create table reactions_limiting_potential
( (
Value NUMERIC NOT NULL value numeric not null
); );
CREATE TABLE REACTIONS_ROUGHNESS_CORRELATION create table reactions_roughness_correlation
( (
Value NUMERIC NOT NULL value numeric not null
); );

View File

@@ -1,9 +1,9 @@
-- [JUNCTIONS] -- [JUNCTIONS]
CREATE TABLE JUNCTIONS create table junctions
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) id varchar(32) primary key references _node(id)
, Elevation NUMERIC NOT NULL , elevation numeric not null
, Demand NUMERIC , demand numeric
, Pattern VARCHAR(32) REFERENCES _PATTERN(ID) , pattern varchar(32) references _pattern(id)
); );

View File

@@ -1,10 +1,10 @@
-- [MIXING] -- [MIXING]
CREATE TYPE MIXING_Model AS ENUM ('MIXED', '2COMP', 'FIFO', 'LIFO'); create type mixing_model as enum ('mixed', '2comp', 'fifo', 'lifo');
CREATE TABLE MIXING create table mixing
( (
Tank VARCHAR(32) PRIMARY KEY REFERENCES TANKS(ID) tank varchar(32) primary key references tanks(id)
, Model MIXING_Model NOT NULL , model mixing_model not null
, Value NUMERIC , value numeric
); );

View File

@@ -2,8 +2,8 @@
-- TODO: constraint -- TODO: constraint
CREATE TABLE TIMES create table times
( (
Key TEXT NOT NULL key text not null
, Value TEXT NOT NULL , value text not null
); );

View File

@@ -2,8 +2,8 @@
-- TODO: constraint -- TODO: constraint
CREATE TABLE REPORT create table report
( (
Key TEXT NOT NULL key text not null
, Value TEXT NOT NULL , value text not null
); );

View File

@@ -2,8 +2,8 @@
-- TODO: constraint -- TODO: constraint
CREATE TABLE OPTIONS create table options
( (
Key TEXT NOT NULL key text not null
, Value TEXT NOT NULL , value text not null
); );

View File

@@ -1,10 +1,10 @@
-- [COORDINATES] -- [COORDINATES]
CREATE TABLE COORDINATES create table coordinates
( (
Node VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) node varchar(32) primary key references _node(id)
, Coord POINT NOT NULL , coord point not null
); );
CREATE INDEX COORDINATES_SPGIST ON COORDINATES USING SPGIST(Coord); create index coordinates_spgist on coordinates using spgist(coord);
CREATE INDEX COORDINATES_GIST ON COORDINATES USING GIST(Coord); create index coordinates_gist on coordinates using gist(coord);

View File

@@ -1,8 +1,8 @@
-- [VERTICES] -- [VERTICES]
CREATE TABLE VERTICES create table vertices
( (
Link VARCHAR(32) REFERENCES _LINK(ID) NOT NULL link varchar(32) references _link(id) not null
, X NUMERIC NOT NULL , x numeric not null
, Y NUMERIC NOT NULL , y numeric not null
); );

View File

@@ -1,9 +1,9 @@
-- [LABELS] -- [LABELS]
CREATE TABLE LABELS create table labels
( (
X NUMERIC NOT NULL x numeric not null
, Y NUMERIC NOT NULL , y numeric not null
, Label TEXT NOT NULL , label text not null
, AnchorNode VARCHAR(32) REFERENCES _NODE(ID) , anchornode varchar(32) references _node(id)
); );

View File

@@ -1,6 +1,6 @@
-- [BACKDROP] -- [BACKDROP]
CREATE TABLE BACKDROP create table backdrop
( (
Content TEXT PRIMARY KEY content text primary key
); );

View File

@@ -1,8 +1,8 @@
-- [RESERVOIRS] -- [RESERVOIRS]
CREATE TABLE RESERVOIRS create table reservoirs
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) id varchar(32) primary key references _node(id)
, Head NUMERIC NOT NULL , head numeric not null
, Pattern VARCHAR(32) REFERENCES _PATTERN(ID) , pattern varchar(32) references _pattern(id)
); );

View File

@@ -1,16 +1,16 @@
-- [TANKS] -- [TANKS]
CREATE TYPE TANKS_OVERFLOW AS ENUM ('yes', 'no'); create type tanks_overflow as enum ('yes', 'no');
CREATE TABLE TANKS create table tanks
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) id varchar(32) primary key references _node(id)
, Elevation NUMERIC NOT NULL , elevation numeric not null
, Init_Level NUMERIC NOT NULL , init_level numeric not null
, Min_Level NUMERIC NOT NULL , min_level numeric not null
, Max_Level NUMERIC NOT NULL , max_level numeric not null
, Diameter NUMERIC NOT NULL , diameter numeric not null
, Min_Vol NUMERIC NOT NULL , min_vol numeric not null
, Vol_Curve VARCHAR(32) REFERENCES _CURVE(ID) , vol_curve varchar(32) references _curve(id)
, Overflow TANKS_OVERFLOW , overflow tanks_overflow
); );

View File

@@ -1,15 +1,15 @@
-- [PIPES] -- [PIPES]
CREATE TYPE PIPES_STATUS AS ENUM ('open', 'closed', 'cv'); create type pipes_status as enum ('open', 'closed', 'cv');
CREATE TABLE PIPES create table pipes
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) id varchar(32) primary key references _link(id)
, Node1 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , node1 varchar(32) references _node(id) not null
, Node2 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , node2 varchar(32) references _node(id) not null
, Length NUMERIC NOT NULL , length numeric not null
, Diameter NUMERIC NOT NULL , diameter numeric not null
, Roughness NUMERIC NOT NULL , roughness numeric not null
, Minor_Loss NUMERIC NOT NULL , minor_loss numeric not null
, Status PIPES_STATUS NOT NULL , status pipes_status not null
); );

View File

@@ -1,32 +1,32 @@
-- [PUMPS] -- [PUMPS]
CREATE TABLE PUMPS create table pumps
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) id varchar(32) primary key references _link(id)
, Node1 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , node1 varchar(32) references _node(id) not null
, Node2 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , node2 varchar(32) references _node(id) not null
); );
CREATE TABLE PUMPS_PROPERTY_POWER create table pumps_property_power
( (
ID VARCHAR PRIMARY KEY REFERENCES PUMPS(ID) id varchar primary key references pumps(id)
, Value VARCHAR(32) NOT NULL , value varchar(32) not null
); );
CREATE TABLE PUMPS_PROPERTY_SPEED create table pumps_property_speed
( (
ID VARCHAR PRIMARY KEY REFERENCES PUMPS(ID) id varchar primary key references pumps(id)
, Value VARCHAR(32) NOT NULL , value varchar(32) not null
); );
CREATE TABLE PUMPS_PROPERTY_HEAD create table pumps_property_head
( (
ID VARCHAR PRIMARY KEY REFERENCES PUMPS(ID) id varchar primary key references pumps(id)
, Head VARCHAR(32) REFERENCES _CURVE(ID) NOT NULL , head varchar(32) references _curve(id) not null
); );
CREATE TABLE PUMPS_PROPERTY_PATTERN create table pumps_property_pattern
( (
ID VARCHAR PRIMARY KEY REFERENCES PUMPS(ID) id varchar primary key references pumps(id)
, Pattern VARCHAR(32) REFERENCES _PATTERN(ID) NOT NULL , pattern varchar(32) references _pattern(id) not null
); );

View File

@@ -1,14 +1,14 @@
-- [VALVES] -- [VALVES]
CREATE TYPE VALVES_TYPE AS ENUM ('prv', 'psv', 'pbv', 'fcv', 'tcv', 'gpv'); create type valves_type as enum ('prv', 'psv', 'pbv', 'fcv', 'tcv', 'gpv');
CREATE TABLE VALVES create table valves
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) id varchar(32) primary key references _link(id)
, Node1 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , node1 varchar(32) references _node(id) not null
, Node2 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , node2 varchar(32) references _node(id) not null
, Diameter NUMERIC NOT NULL , diameter numeric not null
, Type VALVES_TYPE NOT NULL , type valves_type not null
, Setting NUMERIC NOT NULL , setting numeric not null
, Minor_Loss NUMERIC NOT NULL , minor_loss numeric not null
); );

View File

@@ -1,13 +1,13 @@
-- [TAGS] -- [TAGS]
CREATE TABLE TAGS_NODE create table tags_node
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) id varchar(32) primary key references _node(id)
, Tag TEXT NOT NULL , tag text not null
); );
CREATE TABLE TAGS_LINK create table tags_link
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) id varchar(32) primary key references _link(id)
, Tag TEXT NOT NULL , tag text not null
); );

View File

@@ -1,9 +1,9 @@
-- [DEMANDS] -- [DEMANDS]
CREATE TABLE DEMANDS create table demands
( (
Junction VARCHAR(32) REFERENCES JUNCTIONS(ID) NOT NULL junction varchar(32) references junctions(id) not null
, Demand NUMERIC NOT NULL , demand numeric not null
, Pattern VARCHAR(32) REFERENCES _PATTERN(ID) , pattern varchar(32) references _pattern(id)
, Category TEXT NOT NULL , category text not null
); );

View File

@@ -1,36 +1,36 @@
CREATE TYPE API_OPERATION AS ENUM ('init', 'add', 'delete', 'update'); create type api_operation as enum ('init', 'add', 'delete', 'update');
CREATE TABLE OPERATION create table operation
( (
ID SERIAL PRIMARY KEY id serial primary key
, Redo TEXT NOT NULL , redo text not null
, Undo TEXT NOT NULL , undo text not null
, Parent INTEGER REFERENCES OPERATION(ID) , parent integer references operation(id)
, Redo_Child INTEGER REFERENCES OPERATION(ID) , redo_child integer references operation(id)
, Api_Id TEXT NOT NULL , api_id text not null
, Api_Op API_OPERATION NOT NULL , api_op api_operation not null
, Api_Object_Type TEXT NOT NULL , api_object_type text not null
, Api_Object_Id TEXT NOT NULL , api_object_id text not null
, Api_Object_Properties TEXT[] , api_object_properties text[]
); );
INSERT INTO OPERATION (ID, Redo, Undo, Api_Id, Api_Op, Api_Object_Type, Api_Object_Id) VALUES (0, '', '', '', 'init', '', ''); insert into operation (id, redo, undo, api_id, api_op, api_object_type, api_object_id) values (0, '', '', '', 'init', '', '');
CREATE TABLE CURRENT_OPERATION create table current_operation
( (
ID INTEGER PRIMARY KEY REFERENCES OPERATION(ID) id integer primary key references operation(id)
); );
INSERT INTO CURRENT_OPERATION (ID) VALUES (0); insert into current_operation (id) values (0);
CREATE TABLE SNAPSHOT_OPERATION create table snapshot_operation
( (
ID INTEGER PRIMARY KEY REFERENCES OPERATION(ID) id integer primary key references operation(id)
, Tag TEXT NOT NULL UNIQUE , tag text not null unique
); );
CREATE TABLE TRANSACTION_OPERATION create table transaction_operation
( (
ID INTEGER PRIMARY KEY REFERENCES OPERATION(ID) id integer primary key references operation(id)
, STRICT BOOLEAN NOT NULL DEFAULT FALSE , strict boolean not null default false
); );

View File

@@ -1,11 +1,11 @@
DROP TABLE IF EXISTS _PATTERN; drop table if exists _pattern;
DROP TABLE IF EXISTS _CURVE; drop table if exists _curve;
DROP TABLE IF EXISTS _LINK; drop table if exists _link;
DROP TABLE IF EXISTS _NODE; drop table if exists _node;
DROP TYPE IF EXISTS _LINK_TYPE; drop type if exists _link_type;
DROP TYPE IF EXISTS _NODE_TYPE; drop type if exists _node_type;

View File

@@ -1,3 +1,3 @@
-- [TITLE] -- [TITLE]
DROP TABLE IF EXISTS TITLE; drop table if exists title;

View File

@@ -1,13 +1,13 @@
-- [STATUS] -- [STATUS]
DROP TABLE IF EXISTS STATUS_LINK; drop table if exists status_link;
DROP TABLE IF EXISTS STATUS_VALVE; drop table if exists status_valve;
DROP TYPE IF EXISTS STATUS_VALVE_STATUS; drop type if exists status_valve_status;
DROP TABLE IF EXISTS STATUS_PUMP; drop table if exists status_pump;
DROP TABLE IF EXISTS STATUS_PIPE; drop table if exists status_pipe;
DROP TYPE IF EXISTS STATUS_PIPE_PUMP_STATUS; drop type if exists status_pipe_pump_status;

View File

@@ -1,3 +1,3 @@
-- [PATTERNS] -- [PATTERNS]
DROP TABLE IF EXISTS PATTERNS; drop table if exists patterns;

View File

@@ -1,3 +1,3 @@
-- [CURVES] -- [CURVES]
DROP TABLE IF EXISTS CURVES; drop table if exists curves;

View File

@@ -1,9 +1,9 @@
-- [CONTROLS] -- [CONTROLS]
DROP TABLE IF EXISTS CONTROLS_3; drop table if exists controls_3;
DROP TABLE IF EXISTS CONTROLS_2; drop table if exists controls_2;
DROP TABLE IF EXISTS CONTROLS_1; drop table if exists controls_1;
DROP TYPE IF EXISTS CONTROLS_1_PREP; drop type if exists controls_1_prep;

View File

@@ -1,3 +1,3 @@
-- [RULES] -- [RULES]
DROP TABLE IF EXISTS RULES; drop table if exists rules;

View File

@@ -1,9 +1,9 @@
-- [ENERGY] -- [ENERGY]
DROP TABLE IF EXISTS ENERGY_DEMAND_CHARGE; drop table if exists energy_demand_charge;
DROP TABLE IF EXISTS ENERGY_PUMP; drop table if exists energy_pump;
DROP TABLE IF EXISTS ENERGY_GLOBAL; drop table if exists energy_global;
DROP TYPE IF EXISTS ENERGY_PARAM; drop type if exists energy_param;

View File

@@ -1,3 +1,3 @@
-- [EMITTERS] -- [EMITTERS]
DROP TABLE IF EXISTS EMITTERS; drop table if exists emitters;

View File

@@ -1,3 +1,3 @@
-- [QUALITY] -- [QUALITY]
DROP TABLE IF EXISTS QUALITY; drop table if exists quality;

View File

@@ -1,5 +1,5 @@
-- [SOURCES] -- [SOURCES]
DROP TABLE IF EXISTS SOURCES; drop table if exists sources;
DROP TYPE IF EXISTS SOURCES_TYPE; drop type if exists sources_type;

View File

@@ -1,19 +1,19 @@
-- [REACTIONS] -- [REACTIONS]
DROP TABLE IF EXISTS REACTIONS_ROUGHNESS_CORRELATION; drop table if exists reactions_roughness_correlation;
DROP TABLE IF EXISTS REACTIONS_LIMITING_POTENTIAL; drop table if exists reactions_limiting_potential;
DROP TABLE IF EXISTS REACTIONS_TANK; drop table if exists reactions_tank;
DROP TABLE IF EXISTS REACTIONS_PIPE; drop table if exists reactions_pipe;
DROP TYPE IF EXISTS REACTIONS_PIPE_PARAM; drop type if exists reactions_pipe_param;
DROP TABLE IF EXISTS REACTIONS_GLOBAL; drop table if exists reactions_global;
DROP TYPE IF EXISTS REACTIONS_GLOBAL_PARAM; drop type if exists reactions_global_param;
DROP TABLE IF EXISTS REACTIONS_ORDER; drop table if exists reactions_order;
DROP TYPE IF EXISTS REACTIONS_ORDER_PARAM; drop type if exists reactions_order_param;

View File

@@ -1,3 +1,3 @@
-- [JUNCTIONS] -- [JUNCTIONS]
DROP TABLE IF EXISTS JUNCTIONS; drop table if exists junctions;

View File

@@ -1,5 +1,5 @@
-- [MIXING] -- [MIXING]
DROP TABLE IF EXISTS MIXING; drop table if exists mixing;
DROP TYPE IF EXISTS MIXING_Model; drop type if exists mixing_model;

View File

@@ -1,3 +1,3 @@
-- [TIMES] -- [TIMES]
DROP TABLE IF EXISTS TIMES; drop table if exists times;

View File

@@ -1,3 +1,3 @@
-- [REPORT] -- [REPORT]
DROP TABLE IF EXISTS REPORT; drop table if exists report;

View File

@@ -1,3 +1,3 @@
-- [OPTIONS] -- [OPTIONS]
DROP TABLE IF EXISTS OPTIONS; drop table if exists options;

View File

@@ -1,7 +1,7 @@
-- [COORDINATES] -- [COORDINATES]
DROP INDEX IF EXISTS COORDINATES_GIST; drop index if exists coordinates_gist;
DROP INDEX IF EXISTS COORDINATES_SPGIST; drop index if exists coordinates_spgist;
DROP TABLE IF EXISTS COORDINATES; drop table if exists coordinates;

View File

@@ -1,3 +1,3 @@
-- [VERTICES] -- [VERTICES]
DROP TABLE IF EXISTS VERTICES; drop table if exists vertices;

View File

@@ -1,3 +1,3 @@
-- [LABELS] -- [LABELS]
DROP TABLE IF EXISTS LABELS; drop table if exists labels;

View File

@@ -1,3 +1,3 @@
-- [BACKDROP] -- [BACKDROP]
DROP TABLE IF EXISTS BACKDROP; drop table if exists backdrop;

View File

@@ -1,3 +1,3 @@
-- [RESERVOIRS] -- [RESERVOIRS]
DROP TABLE IF EXISTS RESERVOIRS; drop table if exists reservoirs;

View File

@@ -1,5 +1,5 @@
-- [TANKS] -- [TANKS]
DROP TABLE IF EXISTS TANKS; drop table if exists tanks;
DROP TYPE IF EXISTS TANKS_OVERFLOW; drop type if exists tanks_overflow;

View File

@@ -1,5 +1,5 @@
-- [PIPES] -- [PIPES]
DROP TABLE IF EXISTS PIPES; drop table if exists pipes;
DROP TYPE IF EXISTS PIPES_STATUS; drop type if exists pipes_status;

View File

@@ -1,11 +1,11 @@
-- [PUMPS] -- [PUMPS]
DROP TABLE IF EXISTS PUMPS_PROPERTY_PATTERN; drop table if exists pumps_property_pattern;
DROP TABLE IF EXISTS PUMPS_PROPERTY_HEAD; drop table if exists pumps_property_head;
DROP TABLE IF EXISTS PUMPS_PROPERTY_SPEED; drop table if exists pumps_property_speed;
DROP TABLE IF EXISTS PUMPS_PROPERTY_POWER; drop table if exists pumps_property_power;
DROP TABLE IF EXISTS PUMPS; drop table if exists pumps;

View File

@@ -1,5 +1,5 @@
-- [VALVES] -- [VALVES]
DROP TABLE IF EXISTS VALVES; drop table if exists valves;
DROP TYPE IF EXISTS VALVES_TYPE; drop type if exists valves_type;

View File

@@ -1,5 +1,5 @@
-- [TAGS] -- [TAGS]
DROP TABLE IF EXISTS TAGS_LINK; drop table if exists tags_link;
DROP TABLE IF EXISTS TAGS_NODE; drop table if exists tags_node;

View File

@@ -1,3 +1,3 @@
-- [DEMANDS] -- [DEMANDS]
DROP TABLE IF EXISTS DEMANDS; drop table if exists demands;

View File

@@ -1,9 +1,9 @@
DROP TABLE IF EXISTS TRANSACTION_OPERATION; drop table if exists transaction_operation;
DROP TABLE IF EXISTS SNAPSHOT_OPERATION; drop table if exists snapshot_operation;
DROP TABLE IF EXISTS CURRENT_OPERATION; drop table if exists current_operation;
DROP TABLE IF EXISTS OPERATION; drop table if exists operation;
DROP TYPE IF EXISTS API_OPERATION; drop type if exists api_operation;