diff --git a/script/sql/create/10.status.sql b/script/sql/create/10.status.sql index b452337..f0ddb3e 100644 --- a/script/sql/create/10.status.sql +++ b/script/sql/create/10.status.sql @@ -6,7 +6,7 @@ create table status ( link varchar(32) primary key references _link(id) , status link_status -, setting numeric +, setting float8 , check (status is not null or setting is not null) ); diff --git a/script/sql/create/11.patterns.sql b/script/sql/create/11.patterns.sql index d77671f..4e655be 100644 --- a/script/sql/create/11.patterns.sql +++ b/script/sql/create/11.patterns.sql @@ -4,5 +4,5 @@ create table patterns ( _order serial primary key , id varchar(32) references _pattern(id) not null -, factor numeric not null +, factor float8 not null ); diff --git a/script/sql/create/12.curves.sql b/script/sql/create/12.curves.sql index bbc05a1..d067b43 100644 --- a/script/sql/create/12.curves.sql +++ b/script/sql/create/12.curves.sql @@ -4,6 +4,6 @@ create table curves ( _order serial primary key , id varchar(32) references _curve(id) not null -, x numeric not null -, y numeric not null +, x float8 not null +, y float8 not null ); diff --git a/script/sql/create/15.energy.sql b/script/sql/create/15.energy.sql index 13a5c7b..ebaa1c7 100644 --- a/script/sql/create/15.energy.sql +++ b/script/sql/create/15.energy.sql @@ -16,7 +16,7 @@ insert into energy (key, value) values create table energy_pump_price ( pump varchar(32) primary key references pumps(id) not null -, price numeric not null +, price float8 not null ); -- delete when delete pump diff --git a/script/sql/create/16.emitters.sql b/script/sql/create/16.emitters.sql index 20ab5eb..e67af0f 100644 --- a/script/sql/create/16.emitters.sql +++ b/script/sql/create/16.emitters.sql @@ -3,7 +3,7 @@ create table emitters ( junction varchar(32) primary key references junctions(id) -, coefficient numeric not null +, coefficient float8 not null ); -- delete when delete junction diff --git a/script/sql/create/17.quality.sql b/script/sql/create/17.quality.sql index 99c1c93..e3d7a52 100644 --- a/script/sql/create/17.quality.sql +++ b/script/sql/create/17.quality.sql @@ -3,7 +3,7 @@ create table quality ( node varchar(32) primary key references _node(id) -, quality numeric not null +, quality float8 not null ); -- delete when delete ndoe diff --git a/script/sql/create/18.sources.sql b/script/sql/create/18.sources.sql index 8849cd6..4073a4e 100644 --- a/script/sql/create/18.sources.sql +++ b/script/sql/create/18.sources.sql @@ -6,7 +6,7 @@ create table sources ( node varchar(32) primary key references _node(id) , type sources_type not null -, strength numeric not null +, strength float8 not null , pattern varchar(32) references _pattern(id) ); diff --git a/script/sql/create/19.reactions.sql b/script/sql/create/19.reactions.sql index 8d97cde..d6dc919 100644 --- a/script/sql/create/19.reactions.sql +++ b/script/sql/create/19.reactions.sql @@ -19,7 +19,7 @@ insert into reactions (key, value) values create table reactions_pipe_bulk ( pipe varchar(32) primary key references pipes(id) not null -, value numeric not null +, value float8 not null ); -- delete when delete pipe @@ -27,7 +27,7 @@ create table reactions_pipe_bulk create table reactions_pipe_wall ( pipe varchar(32) primary key references pipes(id) not null -, value numeric not null +, value float8 not null ); -- delete when delete pipe @@ -35,7 +35,7 @@ create table reactions_pipe_wall create table reactions_tank ( tank varchar(32) primary key references tanks(id) not null -, value numeric not null +, value float8 not null ); -- delete when delete tank diff --git a/script/sql/create/2.junctions.sql b/script/sql/create/2.junctions.sql index b164d2a..bd98928 100644 --- a/script/sql/create/2.junctions.sql +++ b/script/sql/create/2.junctions.sql @@ -3,5 +3,5 @@ create table junctions ( id varchar(32) primary key references _node(id) -, elevation numeric not null +, elevation float8 not null ); diff --git a/script/sql/create/20.mixing.sql b/script/sql/create/20.mixing.sql index f996a71..f6b06a1 100644 --- a/script/sql/create/20.mixing.sql +++ b/script/sql/create/20.mixing.sql @@ -6,7 +6,7 @@ create table mixing ( tank varchar(32) primary key references tanks(id) , model mixing_model not null -, value numeric +, value float8 ); -- delete when delete tank diff --git a/script/sql/create/25.vertices.sql b/script/sql/create/25.vertices.sql index 7949f64..2bb748e 100644 --- a/script/sql/create/25.vertices.sql +++ b/script/sql/create/25.vertices.sql @@ -4,8 +4,8 @@ create table vertices ( _order serial primary key , link varchar(32) references _link(id) not null -, x numeric not null -, y numeric not null +, x float8 not null +, y float8 not null ); -- delete when delete link diff --git a/script/sql/create/26.labels.sql b/script/sql/create/26.labels.sql index 3471229..c8f3a0a 100644 --- a/script/sql/create/26.labels.sql +++ b/script/sql/create/26.labels.sql @@ -2,8 +2,8 @@ create table labels ( - x numeric not null -, y numeric not null + x float8 not null +, y float8 not null , label text not null , node varchar(32) references _node(id) , primary key (x, y) diff --git a/script/sql/create/3.reservoirs.sql b/script/sql/create/3.reservoirs.sql index 4830942..32dae03 100644 --- a/script/sql/create/3.reservoirs.sql +++ b/script/sql/create/3.reservoirs.sql @@ -3,7 +3,7 @@ create table reservoirs ( id varchar(32) primary key references _node(id) -, head numeric not null +, head float8 not null , pattern varchar(32) references _pattern(id) ); diff --git a/script/sql/create/30.scada_device_data.sql b/script/sql/create/30.scada_device_data.sql index 8919bf6..f328974 100644 --- a/script/sql/create/30.scada_device_data.sql +++ b/script/sql/create/30.scada_device_data.sql @@ -2,6 +2,6 @@ create table scada_device_data ( device_id text not null references scada_device(id) , time timestamp not null -, value numeric not null +, value float8 not null , primary key (device_id, time) ); diff --git a/script/sql/create/31.scada_element.sql b/script/sql/create/31.scada_element.sql index b23c92a..261a996 100644 --- a/script/sql/create/31.scada_element.sql +++ b/script/sql/create/31.scada_element.sql @@ -5,8 +5,8 @@ create type scada_element_status as enum ('OFF', 'ON'); create table scada_element ( id text primary key -, x numeric not null -, y numeric not null +, x float8 not null +, y float8 not null , device_id text references scada_device(id) , model_id varchar(32) -- add constraint in API , model_type scada_model_type diff --git a/script/sql/create/32.region.sql b/script/sql/create/32.region.sql index a8dff0f..b4ec745 100644 --- a/script/sql/create/32.region.sql +++ b/script/sql/create/32.region.sql @@ -33,5 +33,5 @@ create table temp_vd_topology id serial , source integer , target integer -, cost numeric +, cost float8 ); diff --git a/script/sql/create/4.tanks.sql b/script/sql/create/4.tanks.sql index 6376ee8..87663cc 100644 --- a/script/sql/create/4.tanks.sql +++ b/script/sql/create/4.tanks.sql @@ -5,12 +5,12 @@ create type tanks_overflow as enum ('YES', 'NO'); create table tanks ( id varchar(32) primary key references _node(id) -, elevation numeric not null -, init_level numeric not null -, min_level numeric not null -, max_level numeric not null -, diameter numeric not null -, min_vol numeric not null +, elevation float8 not null +, init_level float8 not null +, min_level float8 not null +, max_level float8 not null +, diameter float8 not null +, min_vol float8 not null , vol_curve varchar(32) references _curve(id) , overflow tanks_overflow ); diff --git a/script/sql/create/5.pipes.sql b/script/sql/create/5.pipes.sql index d276bd8..8c04f0f 100644 --- a/script/sql/create/5.pipes.sql +++ b/script/sql/create/5.pipes.sql @@ -7,10 +7,10 @@ create table pipes id varchar(32) primary key references _link(id) , node1 varchar(32) references _node(id) not null , node2 varchar(32) references _node(id) not null -, length numeric not null -, diameter numeric not null -, roughness numeric not null -, minor_loss numeric not null +, length float8 not null +, diameter float8 not null +, roughness float8 not null +, minor_loss float8 not null , status pipes_status not null , check (node1 <> node2) ); diff --git a/script/sql/create/6.pumps.sql b/script/sql/create/6.pumps.sql index 2bc50e0..83cc74f 100644 --- a/script/sql/create/6.pumps.sql +++ b/script/sql/create/6.pumps.sql @@ -5,9 +5,9 @@ create table pumps id varchar(32) primary key references _link(id) , node1 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) -, speed numeric +, speed float8 , pattern varchar(32) references _pattern(id) , check (power is not null or head is not null) , check ((power is not null and head is not null) is false) diff --git a/script/sql/create/7.valves.sql b/script/sql/create/7.valves.sql index a815214..f8b7e76 100644 --- a/script/sql/create/7.valves.sql +++ b/script/sql/create/7.valves.sql @@ -7,10 +7,10 @@ create table valves id varchar(32) primary key references _link(id) , node1 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 , setting text not null -, minor_loss numeric not null +, minor_loss float8 not null ); -- delete when delete node1 diff --git a/script/sql/create/9.demands.sql b/script/sql/create/9.demands.sql index 04e1132..a2c3a2d 100644 --- a/script/sql/create/9.demands.sql +++ b/script/sql/create/9.demands.sql @@ -4,7 +4,7 @@ create table demands ( _order serial primary key , junction varchar(32) references junctions(id) not null -, demand numeric not null +, demand float8 not null , pattern varchar(32) references _pattern(id) , category text );