Replace all "numeric" with "float8"
This commit is contained in:
@@ -6,7 +6,7 @@ create table status
|
|||||||
(
|
(
|
||||||
link varchar(32) primary key references _link(id)
|
link varchar(32) primary key references _link(id)
|
||||||
, status link_status
|
, status link_status
|
||||||
, setting numeric
|
, setting float8
|
||||||
, check (status is not null or setting is not null)
|
, check (status is not null or setting is not null)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -4,5 +4,5 @@ create table patterns
|
|||||||
(
|
(
|
||||||
_order serial primary key
|
_order serial primary key
|
||||||
, id varchar(32) references _pattern(id) not null
|
, id varchar(32) references _pattern(id) not null
|
||||||
, factor numeric not null
|
, factor float8 not null
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -4,6 +4,6 @@ create table curves
|
|||||||
(
|
(
|
||||||
_order serial primary key
|
_order serial primary key
|
||||||
, id varchar(32) references _curve(id) not null
|
, id varchar(32) references _curve(id) not null
|
||||||
, x numeric not null
|
, x float8 not null
|
||||||
, y numeric not null
|
, y float8 not null
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ insert into energy (key, value) values
|
|||||||
create table energy_pump_price
|
create table energy_pump_price
|
||||||
(
|
(
|
||||||
pump varchar(32) primary key references pumps(id) not null
|
pump varchar(32) primary key references pumps(id) not null
|
||||||
, price numeric not null
|
, price float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete pump
|
-- delete when delete pump
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
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 float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete junction
|
-- delete when delete junction
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
create table quality
|
create table quality
|
||||||
(
|
(
|
||||||
node varchar(32) primary key references _node(id)
|
node varchar(32) primary key references _node(id)
|
||||||
, quality numeric not null
|
, quality float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete ndoe
|
-- delete when delete ndoe
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ 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 float8 not null
|
||||||
, pattern varchar(32) references _pattern(id)
|
, pattern varchar(32) references _pattern(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ insert into reactions (key, value) values
|
|||||||
create table reactions_pipe_bulk
|
create table reactions_pipe_bulk
|
||||||
(
|
(
|
||||||
pipe varchar(32) primary key references pipes(id) not null
|
pipe varchar(32) primary key references pipes(id) not null
|
||||||
, value numeric not null
|
, value float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete pipe
|
-- delete when delete pipe
|
||||||
@@ -27,7 +27,7 @@ create table reactions_pipe_bulk
|
|||||||
create table reactions_pipe_wall
|
create table reactions_pipe_wall
|
||||||
(
|
(
|
||||||
pipe varchar(32) primary key references pipes(id) not null
|
pipe varchar(32) primary key references pipes(id) not null
|
||||||
, value numeric not null
|
, value float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete pipe
|
-- delete when delete pipe
|
||||||
@@ -35,7 +35,7 @@ create table reactions_pipe_wall
|
|||||||
create table reactions_tank
|
create table reactions_tank
|
||||||
(
|
(
|
||||||
tank varchar(32) primary key references tanks(id) not null
|
tank varchar(32) primary key references tanks(id) not null
|
||||||
, value numeric not null
|
, value float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete tank
|
-- delete when delete tank
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
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 float8 not null
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ 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 float8
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete tank
|
-- delete when delete tank
|
||||||
|
|||||||
@@ -4,8 +4,8 @@ create table vertices
|
|||||||
(
|
(
|
||||||
_order serial primary key
|
_order serial primary key
|
||||||
, link varchar(32) references _link(id) not null
|
, link varchar(32) references _link(id) not null
|
||||||
, x numeric not null
|
, x float8 not null
|
||||||
, y numeric not null
|
, y float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete link
|
-- delete when delete link
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
create table labels
|
create table labels
|
||||||
(
|
(
|
||||||
x numeric not null
|
x float8 not null
|
||||||
, y numeric not null
|
, y float8 not null
|
||||||
, label text not null
|
, label text not null
|
||||||
, node varchar(32) references _node(id)
|
, node varchar(32) references _node(id)
|
||||||
, primary key (x, y)
|
, primary key (x, y)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
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 float8 not null
|
||||||
, pattern varchar(32) references _pattern(id)
|
, pattern varchar(32) references _pattern(id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ create table scada_device_data
|
|||||||
(
|
(
|
||||||
device_id text not null references scada_device(id)
|
device_id text not null references scada_device(id)
|
||||||
, time timestamp not null
|
, time timestamp not null
|
||||||
, value numeric not null
|
, value float8 not null
|
||||||
, primary key (device_id, time)
|
, primary key (device_id, time)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ create type scada_element_status as enum ('OFF', 'ON');
|
|||||||
create table scada_element
|
create table scada_element
|
||||||
(
|
(
|
||||||
id text primary key
|
id text primary key
|
||||||
, x numeric not null
|
, x float8 not null
|
||||||
, y numeric not null
|
, y float8 not null
|
||||||
, device_id text references scada_device(id)
|
, device_id text references scada_device(id)
|
||||||
, model_id varchar(32) -- add constraint in API
|
, model_id varchar(32) -- add constraint in API
|
||||||
, model_type scada_model_type
|
, model_type scada_model_type
|
||||||
|
|||||||
@@ -33,5 +33,5 @@ create table temp_vd_topology
|
|||||||
id serial
|
id serial
|
||||||
, source integer
|
, source integer
|
||||||
, target integer
|
, target integer
|
||||||
, cost numeric
|
, cost float8
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,12 +5,12 @@ 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 float8 not null
|
||||||
, init_level numeric not null
|
, init_level float8 not null
|
||||||
, min_level numeric not null
|
, min_level float8 not null
|
||||||
, max_level numeric not null
|
, max_level float8 not null
|
||||||
, diameter numeric not null
|
, diameter float8 not null
|
||||||
, min_vol numeric not null
|
, min_vol float8 not null
|
||||||
, vol_curve varchar(32) references _curve(id)
|
, vol_curve varchar(32) references _curve(id)
|
||||||
, overflow tanks_overflow
|
, overflow tanks_overflow
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ 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 float8 not null
|
||||||
, diameter numeric not null
|
, diameter float8 not null
|
||||||
, roughness numeric not null
|
, roughness float8 not null
|
||||||
, minor_loss numeric not null
|
, minor_loss float8 not null
|
||||||
, status pipes_status not null
|
, status pipes_status not null
|
||||||
, check (node1 <> node2)
|
, check (node1 <> node2)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ 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
|
||||||
, power numeric
|
, power float8
|
||||||
, head varchar(32) references _curve(id)
|
, head varchar(32) references _curve(id)
|
||||||
, speed numeric
|
, speed float8
|
||||||
, pattern varchar(32) references _pattern(id)
|
, pattern varchar(32) references _pattern(id)
|
||||||
, check (power is not null or head is not null)
|
, check (power is not null or head is not null)
|
||||||
, check ((power is not null and head is not null) is false)
|
, check ((power is not null and head is not null) is false)
|
||||||
|
|||||||
@@ -7,10 +7,10 @@ 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 float8 not null
|
||||||
, type valves_type not null
|
, type valves_type not null
|
||||||
, setting text not null
|
, setting text not null
|
||||||
, minor_loss numeric not null
|
, minor_loss float8 not null
|
||||||
);
|
);
|
||||||
|
|
||||||
-- delete when delete node1
|
-- delete when delete node1
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ create table demands
|
|||||||
(
|
(
|
||||||
_order serial primary key
|
_order serial primary key
|
||||||
, junction varchar(32) references junctions(id) not null
|
, junction varchar(32) references junctions(id) not null
|
||||||
, demand numeric not null
|
, demand float8 not null
|
||||||
, pattern varchar(32) references _pattern(id)
|
, pattern varchar(32) references _pattern(id)
|
||||||
, category text
|
, category text
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user