Put all table & enum into namespace(postgres schema) 'tj'

This commit is contained in:
wqy
2022-09-03 14:38:49 +08:00
parent 19b690b665
commit 7d2cc5c1fe
58 changed files with 401 additions and 340 deletions

View File

@@ -1,6 +1,16 @@
create type tj.node_type as enum ('junction', 'reservoir', 'tank'); create type tj.node_type as enum
(
'junction'
, 'reservoir'
, 'tank'
);
create type tj.link_type as enum ('pipe', 'pump', 'valve'); create type tj.link_type as enum
(
'pipe'
, 'pump'
, 'valve'
);
create table tj.node create table tj.node
( (

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
-- [PATTERNS] -- [patterns]
CREATE TABLE PATTERNS create table tj.patterns
( (
ID VARCHAR(32) REFERENCES _PATTERN(ID) NOT NULL id varchar(32) references tj.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 tj.curves
( (
ID VARCHAR(32) REFERENCES _CURVE(ID) NOT NULL id varchar(32) references tj.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 tj.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 tj.controls_1
( (
LinkID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) linkid varchar(32) primary key references tj.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 tj.node(id) not null
, Prep CONTROLS_1_PREP NOT NULL , prep tj.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 tj.controls_2
( (
LinkID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) linkid varchar(32) primary key references tj.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 tj.controls_3
( (
LinkID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) linkid varchar(32) primary key references tj.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
, ClockTimeHour INTERVAL HOUR -- get AM/PM from it , clocktimehour interval hour -- get am/pm from it
, ClockTimeMin INTERVAL MINUTE , clocktimemin interval minute
); );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,9 +1,9 @@
-- [TIMES] -- [times]
-- TODO: constraint -- todo: constraint
CREATE TABLE TIMES create table tj.times
( (
Key TEXT NOT NULL key text not null
, Value TEXT NOT NULL , value text not null
); );

View File

@@ -1,9 +1,9 @@
-- [REPORT] -- [report]
-- TODO: constraint -- todo: constraint
CREATE TABLE REPORT create table tj.report
( (
Key TEXT NOT NULL key text not null
, Value TEXT NOT NULL , value text not null
); );

View File

@@ -1,9 +1,9 @@
-- [OPTIONS] -- [options]
-- TODO: constraint -- todo: constraint
CREATE TABLE OPTIONS create table tj.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 tj.coordinates
( (
Node VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) node varchar(32) primary key references tj.node(id)
, Coord POINT NOT NULL , coord point not null
); );
CREATE INDEX COORDINATES_SPGIST ON COORDINATES USING SPGIST(Coord); create index tj.coordinates_spgist on tj.coordinates using spgist(coord);
CREATE INDEX COORDINATES_GIST ON COORDINATES USING GIST(Coord); create index tj.coordinates_gist on tj.coordinates using gist(coord);

View File

@@ -1,8 +1,8 @@
-- [VERTICES] -- [vertices]
CREATE TABLE VERTICES create table tj.vertices
( (
Link VARCHAR(32) REFERENCES _LINK(ID) NOT NULL link varchar(32) references tj.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 tj.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 tj.node(id)
); );

View File

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

View File

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

View File

@@ -1,16 +1,20 @@
-- [TANKS] -- [tanks]
CREATE TYPE TANKS_OVERFLOW AS ENUM ('YES', 'NO'); create type tj.tanks_overflow as enum
CREATE TABLE TANKS
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _NODE(ID) 'yes'
, Elevation NUMERIC NOT NULL , 'no'
, InitLevel NUMERIC NOT NULL );
, MinLevel NUMERIC NOT NULL
, MaxLevel NUMERIC NOT NULL create table tj.tanks
, Diameter NUMERIC NOT NULL (
, MinVol NUMERIC NOT NULL id varchar(32) primary key references tj.node(id)
, VolCurve VARCHAR(32) REFERENCES _CURVE(ID) , elevation numeric not null
, Overflow TANKS_OVERFLOW , initlevel numeric not null
, minlevel numeric not null
, maxlevel numeric not null
, diameter numeric not null
, minvol numeric not null
, volcurve varchar(32) references tj.curve(id)
, overflow tj.tanks_overflow
); );

View File

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

View File

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

View File

@@ -1,14 +1,22 @@
-- [VALVES] -- [valves]
CREATE TYPE VALVES_TYPE AS ENUM ('PRV', 'PSV', 'PBV', 'FCV', 'TCV', 'GPV'); create type tj.valves_type as enum
CREATE TABLE VALVES
( (
ID VARCHAR(32) PRIMARY KEY REFERENCES _LINK(ID) 'prv'
, Node1 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , 'psv'
, Node2 VARCHAR(32) REFERENCES _NODE(ID) NOT NULL , 'pbv'
, Diameter NUMERIC NOT NULL , 'fcv'
, Type VALVES_TYPE NOT NULL , 'tcv'
, Setting NUMERIC NOT NULL , 'gpv'
, MinorLoss NUMERIC NOT NULL );
create table tj.valves
(
id varchar(32) primary key references tj.link(id)
, node1 varchar(32) references tj.node(id) not null
, node2 varchar(32) references tj.node(id) not null
, diameter numeric not null
, type tj.valves_type not null
, setting numeric not null
, minorloss numeric not null
); );

View File

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

View File

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

View File

@@ -1,29 +1,29 @@
CREATE TABLE OPERATION create table tj.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 tj.operation(id)
, Redo_Child INTEGER REFERENCES OPERATION(ID) , redo_child integer references tj.operation(id)
); );
INSERT INTO OPERATION (ID, Redo, Undo) VALUES (0, '', ''); insert into tj.operation (id, redo, undo) values (0, '', '');
CREATE TABLE CURRENT_OPERATION create table tj.current_operation
( (
ID INTEGER PRIMARY KEY REFERENCES OPERATION(ID) id integer primary key references tj.operation(id)
); );
INSERT INTO CURRENT_OPERATION (ID) VALUES (0); insert into tj.current_operation (id) values (0);
CREATE TABLE SNAPSHOT_OPERATION create table tj.snapshot_operation
( (
ID INTEGER PRIMARY KEY REFERENCES OPERATION(ID) id integer primary key references tj.operation(id)
, Tag TEXT NOT NULL UNIQUE , tag text not null unique
); );
CREATE TABLE TRANSACTION_OPERATION create table tj.transaction_operation
( (
ID INTEGER PRIMARY KEY REFERENCES OPERATION(ID) id integer primary key references tj.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 tj.pattern;
DROP TABLE IF EXISTS _CURVE; drop table if exists tj.curve;
DROP TABLE IF EXISTS _LINK; drop table if exists tj.link;
DROP TABLE IF EXISTS _NODE; drop table if exists tj.node;
DROP TYPE IF EXISTS _LINK_TYPE; drop type if exists tj.link_type;
DROP TYPE IF EXISTS _NODE_TYPE; drop type if exists tj.node_type;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,7 +1,7 @@
DROP TABLE IF EXISTS TRANSACTION_OPERATION; drop table if exists tj.transaction_operation;
DROP TABLE IF EXISTS SNAPSHOT_OPERATION; drop table if exists tj.snapshot_operation;
DROP TABLE IF EXISTS CURRENT_OPERATION; drop table if exists tj.current_operation;
DROP TABLE IF EXISTS OPERATION; drop table if exists tj.operation;