diff --git a/03_qgep_db_dss.sql b/03_qgep_db_dss.sql index 83b303905..ce0e4bb96 100644 --- a/03_qgep_db_dss.sql +++ b/03_qgep_db_dss.sql @@ -1,6 +1,6 @@ ------ This file generates the VSA-DSS database (Modul VSA-DSS) in en on QQIS ------ For questions etc. please contact Stefan Burckhardt stefan.burckhardt@sjib.ch ------- version 03.07.2017 21:26:28 +------ version 03.07.2017 21:26:28 / updated 29.3.2023 BEGIN; ------ CREATE SCHEMA qgep; @@ -2072,10 +2072,10 @@ CREATE SEQUENCE qgep_od.seq_overflow_char_oid INCREMENT 1 MINVALUE 0 MAXVALUE 99 COMMENT ON COLUMN qgep_od.overflow_char.obj_id IS '[primary_key] INTERLIS STANDARD OID (with Postfix/Präfix) or UUOID, see www.interlis.ch'; ALTER TABLE qgep_od.overflow_char ADD COLUMN identifier varchar(20) ; COMMENT ON COLUMN qgep_od.overflow_char.identifier IS ''; -ALTER TABLE qgep_od.overflow_char ADD COLUMN kind_overflow_characteristic integer ; -COMMENT ON COLUMN qgep_od.overflow_char.kind_overflow_characteristic IS 'yyy_Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben. / Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben. / La courbe est à documenter sous forme de rapport Q/Q (Leaping weir) ou H/Q (déversoir latéral). Les conditions d’écoulement dans la chambre d’accumulation sont à fournir en annexe.'; -ALTER TABLE qgep_od.overflow_char ADD COLUMN overflow_characteristic_digital integer ; -COMMENT ON COLUMN qgep_od.overflow_char.overflow_characteristic_digital IS 'yyy_Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in Ueberlaufcharakteristik ausgefüllt sein in HQ_Relation. / Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in HQ_Relation ausgefüllt sein. / Si courbe de fonctionnement numérique = oui, les attributs pour les relations Q-Q et H-Q doivent être saisis dans la classe RELATION_HQ.'; +ALTER TABLE qgep_od.overflow_char ADD COLUMN kind_overflow_char integer ; +COMMENT ON COLUMN qgep_od.overflow_char.kind_overflow_char IS 'yyy_Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben. / Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben. / La courbe est à documenter sous forme de rapport Q/Q (Leaping weir) ou H/Q (déversoir latéral). Les conditions d’écoulement dans la chambre d’accumulation sont à fournir en annexe.'; +ALTER TABLE qgep_od.overflow_char ADD COLUMN overflow_char_digital integer ; +COMMENT ON COLUMN qgep_od.overflow_char.overflow_char_digital IS 'yyy_Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in Ueberlaufcharakteristik ausgefüllt sein in HQ_Relation. / Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in HQ_Relation ausgefüllt sein. / Si courbe de fonctionnement numérique = oui, les attributs pour les relations Q-Q et H-Q doivent être saisis dans la classe RELATION_HQ.'; ALTER TABLE qgep_od.overflow_char ADD COLUMN remark varchar(80) ; COMMENT ON COLUMN qgep_od.overflow_char.remark IS 'General remarks / Allgemeine Bemerkungen / Remarques générales'; ALTER TABLE qgep_od.overflow_char ADD COLUMN last_modification TIMESTAMP without time zone DEFAULT now(); @@ -4369,24 +4369,24 @@ ALTER TABLE qgep_vl.retention_body_kind ADD CONSTRAINT pkey_qgep_vl_retention_bo ON UPDATE RESTRICT ON DELETE RESTRICT; ALTER TABLE qgep_od.retention_body ADD COLUMN fk_infiltration_installation varchar (16); ALTER TABLE qgep_od.retention_body ADD CONSTRAINT rel_retention_body_infiltration_installation FOREIGN KEY (fk_infiltration_installation) REFERENCES qgep_od.infiltration_installation(obj_id) ON UPDATE CASCADE ON DELETE cascade; -CREATE TABLE qgep_vl.overflow_char_kind_overflow_characteristic () INHERITS (qgep_sys.value_list_base); -ALTER TABLE qgep_vl.overflow_char_kind_overflow_characteristic ADD CONSTRAINT pkey_qgep_vl_overflow_char_kind_overflow_characteristic_code PRIMARY KEY (code); - INSERT INTO qgep_vl.overflow_char_kind_overflow_characteristic (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6220,6220,'hq','HQ','HQ', 'HQ', '', '', '', '', '', '', 'true'); - INSERT INTO qgep_vl.overflow_char_kind_overflow_characteristic (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6221,6221,'qq','QQ','QQ', 'QQ', '', '', '', '', '', '', 'true'); - INSERT INTO qgep_vl.overflow_char_kind_overflow_characteristic (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6228,6228,'unknown','unbekannt','inconnu', 'sconosciuto', '', '', '', '', '', '', 'true'); - ALTER TABLE qgep_od.overflow_char ADD CONSTRAINT fkey_vl_overflow_char_kind_overflow_characteristic FOREIGN KEY (kind_overflow_characteristic) - REFERENCES qgep_vl.overflow_char_kind_overflow_characteristic (code) MATCH SIMPLE - ON UPDATE RESTRICT ON DELETE RESTRICT; -CREATE TABLE qgep_vl.overflow_char_overflow_characteristic_digital () INHERITS (qgep_sys.value_list_base); -ALTER TABLE qgep_vl.overflow_char_overflow_characteristic_digital ADD CONSTRAINT pkey_qgep_vl_overflow_char_overflow_characteristic_digital_code PRIMARY KEY (code); - INSERT INTO qgep_vl.overflow_char_overflow_characteristic_digital (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6223,6223,'yes','ja','oui', 'si', '', '', '', '', '', '', 'true'); - INSERT INTO qgep_vl.overflow_char_overflow_characteristic_digital (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6224,6224,'no','nein','non', 'no', '', '', '', '', '', '', 'true'); - INSERT INTO qgep_vl.overflow_char_overflow_characteristic_digital (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6225,6225,'unknown','unbekannt','inconnu', 'sconosciuto', '', '', '', '', '', '', 'true'); - ALTER TABLE qgep_od.overflow_char ADD CONSTRAINT fkey_vl_overflow_char_overflow_characteristic_digital FOREIGN KEY (overflow_characteristic_digital) - REFERENCES qgep_vl.overflow_char_overflow_characteristic_digital (code) MATCH SIMPLE - ON UPDATE RESTRICT ON DELETE RESTRICT; -ALTER TABLE qgep_od.hq_relation ADD COLUMN fk_overflow_characteristic varchar (16); -ALTER TABLE qgep_od.hq_relation ADD CONSTRAINT rel_hq_relation_overflow_characteristic FOREIGN KEY (fk_overflow_characteristic) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE cascade; +CREATE TABLE qgep_vl.overflow_char_kind_overflow_char () INHERITS (qgep_sys.value_list_base); +ALTER TABLE qgep_vl.overflow_char_kind_overflow_char ADD CONSTRAINT pkey_qgep_vl_overflow_char_kind_overflow_char_code PRIMARY KEY (code); + INSERT INTO qgep_vl.overflow_char_kind_overflow_char (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6220,6220,'hq','HQ','HQ', 'HQ', '', '', '', '', '', '', 'true'); + INSERT INTO qgep_vl.overflow_char_kind_overflow_char (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6221,6221,'qq','QQ','QQ', 'QQ', '', '', '', '', '', '', 'true'); + INSERT INTO qgep_vl.overflow_char_kind_overflow_char (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6228,6228,'unknown','unbekannt','inconnu', 'sconosciuto', '', '', '', '', '', '', 'true'); + ALTER TABLE qgep_od.overflow_char ADD CONSTRAINT fkey_vl_overflow_char_kind_overflow_char FOREIGN KEY (kind_overflow_char) + REFERENCES qgep_vl.overflow_char_kind_overflow_char (code) MATCH SIMPLE + ON UPDATE RESTRICT ON DELETE RESTRICT; +CREATE TABLE qgep_vl.overflow_char_overflow_char_digital () INHERITS (qgep_sys.value_list_base); +ALTER TABLE qgep_vl.overflow_char_overflow_char_digital ADD CONSTRAINT pkey_qgep_vl_overflow_char_overflow_char_digital_code PRIMARY KEY (code); + INSERT INTO qgep_vl.overflow_char_overflow_char_digital (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6223,6223,'yes','ja','oui', 'si', '', '', '', '', '', '', 'true'); + INSERT INTO qgep_vl.overflow_char_overflow_char_digital (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6224,6224,'no','nein','non', 'no', '', '', '', '', '', '', 'true'); + INSERT INTO qgep_vl.overflow_char_overflow_char_digital (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (6225,6225,'unknown','unbekannt','inconnu', 'sconosciuto', '', '', '', '', '', '', 'true'); + ALTER TABLE qgep_od.overflow_char ADD CONSTRAINT fkey_vl_overflow_char_overflow_char_digital FOREIGN KEY (overflow_char_digital) + REFERENCES qgep_vl.overflow_char_overflow_char_digital (code) MATCH SIMPLE + ON UPDATE RESTRICT ON DELETE RESTRICT; +ALTER TABLE qgep_od.hq_relation ADD COLUMN fk_overflow_char varchar (16); +ALTER TABLE qgep_od.hq_relation ADD CONSTRAINT rel_hq_relation_overflow_char FOREIGN KEY (fk_overflow_char) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE cascade; CREATE TABLE qgep_vl.structure_part_renovation_demand () INHERITS (qgep_sys.value_list_base); ALTER TABLE qgep_vl.structure_part_renovation_demand ADD CONSTRAINT pkey_qgep_vl_structure_part_renovation_demand_code PRIMARY KEY (code); INSERT INTO qgep_vl.structure_part_renovation_demand (code, vsacode, value_en, value_de, value_fr, value_it, value_ro, abbr_en, abbr_de, abbr_fr, abbr_it, abbr_ro, active) VALUES (138,138,'not_necessary','nicht_notwendig','pas_necessaire', 'zzz_nicht_notwendig', 'nenecesare', 'NN', 'NN', 'PN', '', '', 'true'); @@ -4760,8 +4760,8 @@ ALTER TABLE qgep_od.overflow ADD COLUMN fk_wastewater_node varchar (16); ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_wastewater_node FOREIGN KEY (fk_wastewater_node) REFERENCES qgep_od.wastewater_node(obj_id) ON UPDATE CASCADE ON DELETE cascade; ALTER TABLE qgep_od.overflow ADD COLUMN fk_overflow_to varchar (16); ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_overflow_to FOREIGN KEY (fk_overflow_to) REFERENCES qgep_od.wastewater_node(obj_id) ON UPDATE CASCADE ON DELETE set null; -ALTER TABLE qgep_od.overflow ADD COLUMN fk_overflow_characteristic varchar (16); -ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_overflow_characteristic FOREIGN KEY (fk_overflow_characteristic) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE set null; +ALTER TABLE qgep_od.overflow ADD COLUMN fk_overflow_char varchar (16); +ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_overflow_char FOREIGN KEY (fk_overflow_char) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE set null; ALTER TABLE qgep_od.overflow ADD COLUMN fk_control_center varchar (16); ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_control_center FOREIGN KEY (fk_control_center) REFERENCES qgep_od.control_center(obj_id) ON UPDATE CASCADE ON DELETE set null; CREATE TABLE qgep_vl.throttle_shut_off_unit_actuation () INHERITS (qgep_sys.value_list_base); @@ -4952,8 +4952,8 @@ ALTER TABLE qgep_vl.hydraulic_char_data_status ADD CONSTRAINT pkey_qgep_vl_hydra ON UPDATE RESTRICT ON DELETE RESTRICT; ALTER TABLE qgep_od.hydraulic_char_data ADD COLUMN fk_wastewater_node varchar (16); ALTER TABLE qgep_od.hydraulic_char_data ADD CONSTRAINT rel_hydraulic_char_data_wastewater_node FOREIGN KEY (fk_wastewater_node) REFERENCES qgep_od.wastewater_node(obj_id) ON UPDATE CASCADE ON DELETE set null; -ALTER TABLE qgep_od.hydraulic_char_data ADD COLUMN fk_overflow_characteristic varchar (16); -ALTER TABLE qgep_od.hydraulic_char_data ADD CONSTRAINT rel_hydraulic_char_data_overflow_characteristic FOREIGN KEY (fk_overflow_characteristic) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE set null; +ALTER TABLE qgep_od.hydraulic_char_data ADD COLUMN fk_overflow_char varchar (16); +ALTER TABLE qgep_od.hydraulic_char_data ADD CONSTRAINT rel_hydraulic_char_data_overflow_char FOREIGN KEY (fk_overflow_char) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE set null; ALTER TABLE qgep_od.backflow_prevention ADD CONSTRAINT oorel_od_backflow_prevention_structure_part FOREIGN KEY (obj_id) REFERENCES qgep_od.structure_part(obj_id) ON DELETE CASCADE ON UPDATE CASCADE; CREATE TABLE qgep_vl.backflow_prevention_kind () INHERITS (qgep_sys.value_list_base); ALTER TABLE qgep_vl.backflow_prevention_kind ADD CONSTRAINT pkey_qgep_vl_backflow_prevention_kind_code PRIMARY KEY (code); diff --git a/04_vsa_kek_extension.sql b/04_vsa_kek_extension.sql index 24dc529b7..867f4840b 100644 --- a/04_vsa_kek_extension.sql +++ b/04_vsa_kek_extension.sql @@ -1045,7 +1045,7 @@ ALTER TABLE qgep_vl.file_class ADD CONSTRAINT pkey_qgep_vl_file_class_code PRIMA INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3880,3880,'dryweather_downspout','Trockenwetterfallrohr','TUYAU_CHUTE', '', '', '', 'true'); INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3881,3881,'dryweather_flume','Trockenwetterrinne','CUNETTE_DEBIT_TEMPS_SEC', '', '', '', 'true'); INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3882,3882,'overflow','Ueberlauf','DEVERSOIR', '', '', '', 'true'); - INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3883,3883,'overflow_characteristic','Ueberlaufcharakteristik','CARACTERISTIQUES_DEVERSOIR', '', '', '', 'true'); + INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3883,3883,'overflow_char','Ueberlaufcharakteristik','CARACTERISTIQUES_DEVERSOIR', '', '', '', 'true'); INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3884,3884,'shore','Ufer','RIVE', '', '', '', 'true'); INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3885,3885,'accident','Unfall','ACCIDENT', '', '', '', 'true'); INSERT INTO qgep_vl.file_class (code, vsacode, value_en, value_de, value_fr, abbr_en, abbr_de, abbr_fr, active) VALUES (3886,3886,'inspection','Untersuchung','EXAMEN', '', '', '', 'true'); diff --git a/09_qgep_dictionaries.sql b/09_qgep_dictionaries.sql index 72575ea44..66f95a8ba 100644 --- a/09_qgep_dictionaries.sql +++ b/09_qgep_dictionaries.sql @@ -719,8 +719,8 @@ CREATE TABLE qgep_sys.dictionary_od_field ( INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (63,999999,'overflow','provider','provider','Datenlieferant','FOURNISSEUR_DES_DONNEES','fornitore_dati','rrr_Datenlieferant','Metaattribute provider - this is the person or body who delivered the data','Metaattribut Datenlieferant ist diejenige Person oder Stelle, die die Daten geliefert hat','FOURNISSEUR DES DONNEES Organisation qui crée l’enregistrement de ces données','zzz_Metaattribut L''attributo fornitore dati si riferisce alla persona o ente che ha fornito i dati','rrr_Metaattribut Datenlieferant ist diejenige Person oder Stelle, die die Daten geliefert hat',ARRAY['Werkinformation','Leitungskataster', 'GEP_Verband','GEP_Traegerschaft','SAA', 'PAA']::qgep_od.plantype[],'true','varchar(80)','','','','','','','','','','',NULL,NULL); INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (63,999999,'overflow','last_modification','last_modification','Letzte_Aenderung','DERNIERE_MODIFICATION','ultima_modifica','rrr_Letze_Aenderung','Last modification: INTERLIS_1_DATE','Letzte Änderung: INTERLIS_1_DATE','Dernière modification: INTERLIS_1_DATE','ultima_modifica: INTERLIS_1_DATE','rrr_Letzte Änderung: INTERLIS_1_DATE',ARRAY['Werkinformation','Leitungskataster', 'GEP_Verband','GEP_Traegerschaft','SAA', 'PAA']::qgep_od.plantype[],'true','TIMESTAMP','','','','','','','','','','',NULL,NULL); INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,2538,'overflow_char','identifier','identifier','Bezeichnung','DESIGNATION','denominazione','identificator','NULL','NULL','NULL','NULL','[CHF]',ARRAY['kein_Plantyp_definiert']::qgep_od.plantype[],'true','varchar(20)','','','','','','','','','','',NULL,NULL); - INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,6219,'overflow_char','kind_overflow_characteristic','kind_overflow_characteristic','Kennlinie_Typ','GENRE_COURBE_DE_FONCTIONNEMENT','curva_caratteristica_tipo','tipul_curbei_de_func?ionare','yyy_Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben.','Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben.','La courbe est à documenter sous forme de rapport Q/Q (Leaping weir) ou H/Q (déversoir latéral). Les conditions d’écoulement dans la chambre d’accumulation sont à fournir en annexe.','NULL','[CHF]',ARRAY['GEP_Verband','PAA']::qgep_od.plantype[],'true','integer','','','','','','','','','','',NULL,NULL); - INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,6222,'overflow_char','overflow_characteristic_digital','overflow_characteristic_digital','Kennlinie_digital','COURBE_DE_FONCTIONNEMENT_NUM','curva_caratteristica_digitale','curba_de_func?ionare_numerica','yyy_Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in Ueberlaufcharakteristik ausgefüllt sein in HQ_Relation.','Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in HQ_Relation ausgefüllt sein.','Si courbe de fonctionnement numérique = oui, les attributs pour les relations Q-Q et H-Q doivent être saisis dans la classe RELATION_HQ.','NULL','',ARRAY['GEP_Verband','PAA']::qgep_od.plantype[],'true','integer','','','','','','','','','','',NULL,NULL); + INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,6219,'overflow_char','kind_overflow_char','kind_overflow_char','Kennlinie_Typ','GENRE_COURBE_DE_FONCTIONNEMENT','curva_caratteristica_tipo','tipul_curbei_de_func?ionare','yyy_Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben.','Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben.','La courbe est à documenter sous forme de rapport Q/Q (Leaping weir) ou H/Q (déversoir latéral). Les conditions d’écoulement dans la chambre d’accumulation sont à fournir en annexe.','NULL','[CHF]',ARRAY['GEP_Verband','PAA']::qgep_od.plantype[],'true','integer','','','','','','','','','','',NULL,NULL); + INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,6222,'overflow_char','overflow_char_digital','overflow_char_digital','Kennlinie_digital','COURBE_DE_FONCTIONNEMENT_NUM','curva_caratteristica_digitale','curba_de_func?ionare_numerica','yyy_Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in Ueberlaufcharakteristik ausgefüllt sein in HQ_Relation.','Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in HQ_Relation ausgefüllt sein.','Si courbe de fonctionnement numérique = oui, les attributs pour les relations Q-Q et H-Q doivent être saisis dans la classe RELATION_HQ.','NULL','',ARRAY['GEP_Verband','PAA']::qgep_od.plantype[],'true','integer','','','','','','','','','','',NULL,NULL); INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,2596,'overflow_char','remark','remark','Bemerkung','REMARQUE','osservazione','observa?ie','General remarks','Allgemeine Bemerkungen','Remarques générales','NULL','',ARRAY['kein_Plantyp_definiert']::qgep_od.plantype[],'true','varchar(80)','','','','','','','','','','',NULL,NULL); INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,999999,'overflow_char','OBJ_ID','OBJ_ID','OBJ_ID','OBJ_ID','OBJ_ID','OBJ_ID','OBJ_ID - Unique ID','OBJ_ID - eindeutige Kennung','OBJ_ID - ID unique','OBJ_ID - identificatore univoco','rrr_OBJ_ID - eindeutige Kennung',ARRAY['Werkinformation','Leitungskataster', 'GEP_Verband','GEP_Traegerschaft','SAA', 'PAA']::qgep_od.plantype[],'true','varchar(16)','','','','','','','','','','',NULL,NULL); INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,999999,'overflow_char','dataowner','dataowner','Datenherr','MAITRE_DES_DONNEES','proprietario_dati','rrr_Datenherr','dataowner - this is the person or body who is allowed to delete, change or maintain this object','Metaattribut Datenherr ist diejenige Person oder Stelle, die berechtigt ist, diesen Datensatz zu löschen, zu ändern bzw. zu verwalten','Maître des données gestionnaire de données, qui est la personne ou l''organisation autorisée pour gérer, modifier ou supprimer les données de cette table/classe','zzz_Metaattribut L''attributo proprietario dati si riferisce alla persona o ente che è autorizzato a eliminare, modificare o gestire i dati','rrr_Metaattribut Datenherr ist diejenige Person oder Stelle, die berechtigt ist, diesen Datensatz zu löschen, zu ändern bzw. zu verwalten',ARRAY['Werkinformation','Leitungskataster', 'GEP_Verband','GEP_Traegerschaft','SAA', 'PAA']::qgep_od.plantype[],'true','varchar(80)','','','','','','','','','','',NULL,NULL); @@ -1547,12 +1547,12 @@ CONSTRAINT is_dictionary_od_values_pkey PRIMARY KEY (id) INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (63,2692,2693,'overflow','signal_transmission','sending','sending','','senden','','emettre','','zzz_senden','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (63,2692,2695,'overflow','signal_transmission','sending_receiving','sending_receiving','','senden_empfangen','','emettre_recevoir','','zzz_senden_empfangen','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (63,2692,3056,'overflow','signal_transmission','unknown','unknown','','unbekannt','','inconnu','','sconosciuto','','','',' ','','','',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6220,'overflow_char','kind_overflow_characteristic','hq','hq','','HQ','','HQ','','HQ','','','','yyy_H-Q Beziehung: Hoehe (H) und Durchfluss (Q) Richtung ARA abfüllen','H-Q Beziehung: Hoehe (H) und Durchfluss (Q) Richtung ARA abfüllen','ligne H / Q: H = hauteur d’eau lors du déversement [m.s.m.], Q = débit conservé vers STEP [l/s]','Assegnare altezza (H) e portata (Q)',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6221,'overflow_char','kind_overflow_characteristic','qq','qq','','QQ','','QQ','','QQ','','','','yyy_Q-Q-Beziehung: Zufluss (Q1) und Durchfluss Richtung ARA (Q2) abfüllen','Q-Q-Beziehung: Zufluss (Q1) und Durchfluss Richtung ARA (Q2) abfüllen','ligne Q1 / Q2: Q1 = débit d’entrée [l/s], Q2 = débit acheminé vers STEP [l/s]','Registrare afflusso (Q1) e portata (Q2)',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6228,'overflow_char','kind_overflow_characteristic','unknown','unknown','','unbekannt','','inconnu','','sconosciuto','','','','','','','',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6223,'overflow_char','overflow_characteristic_digital','yes','yes','','ja','','oui','','si','','','','','','','',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6224,'overflow_char','overflow_characteristic_digital','no','no','','nein','','non','','no','','','','','','','',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6225,'overflow_char','overflow_characteristic_digital','unknown','unknown','','unbekannt','','inconnu','','sconosciuto','','','','','','','',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6220,'overflow_char','kind_overflow_char','hq','hq','','HQ','','HQ','','HQ','','','','yyy_H-Q Beziehung: Hoehe (H) und Durchfluss (Q) Richtung ARA abfüllen','H-Q Beziehung: Hoehe (H) und Durchfluss (Q) Richtung ARA abfüllen','ligne H / Q: H = hauteur d’eau lors du déversement [m.s.m.], Q = débit conservé vers STEP [l/s]','Assegnare altezza (H) e portata (Q)',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6221,'overflow_char','kind_overflow_char','qq','qq','','QQ','','QQ','','QQ','','','','yyy_Q-Q-Beziehung: Zufluss (Q1) und Durchfluss Richtung ARA (Q2) abfüllen','Q-Q-Beziehung: Zufluss (Q1) und Durchfluss Richtung ARA (Q2) abfüllen','ligne Q1 / Q2: Q1 = débit d’entrée [l/s], Q2 = débit acheminé vers STEP [l/s]','Registrare afflusso (Q1) e portata (Q2)',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6228,'overflow_char','kind_overflow_char','unknown','unknown','','unbekannt','','inconnu','','sconosciuto','','','','','','','',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6223,'overflow_char','overflow_char_digital','yes','yes','','ja','','oui','','si','','','','','','','',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6224,'overflow_char','overflow_char_digital','no','no','','nein','','non','','no','','','','','','','',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6225,'overflow_char','overflow_char_digital','unknown','unknown','','unbekannt','','inconnu','','sconosciuto','','','','','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (65,189,341,'river_bank','control_grade_of_river','none','none','','keine','','nul','','nessuno','','inexistent','','none (0%)','keine (0%)','nul (0%)','zzz_keine (0%)',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (65,189,2612,'river_bank','control_grade_of_river','moderate','moderate','','maessig','','moyen','','zzz_maessig','','','','moderate (10 - 30 %)','mässig (10 - 30 %)','moyen (10 - 30 %)','zzz_mässig (10 - 30 %)',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (65,189,2613,'river_bank','control_grade_of_river','strong','strong','','stark','','fort','','zzz_stark','','','','strong (30 - 60 %)','stark (30 - 60 %)','fort (30 - 60 %)','zzz_stark (30 - 60 %)',''); diff --git a/09_qgep_dictionaries_kek.sql b/09_qgep_dictionaries_kek.sql index c2856b9e7..b3e23ef3d 100644 --- a/09_qgep_dictionaries_kek.sql +++ b/09_qgep_dictionaries_kek.sql @@ -695,7 +695,7 @@ INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3880,'file','class','dryweather_downspout','dryweather_downspout','','Trockenwetterfallrohr','','TUYAU_CHUTE','','zzz_Trockenwetterfallrohr','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3881,'file','class','dryweather_flume','dryweather_flume','','Trockenwetterrinne','','CUNETTE_DEBIT_TEMPS_SEC','','zzz_Trockenwetterrinne','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3882,'file','class','overflow','overflow','','Ueberlauf','','DEVERSOIR','','zzz_Ueberlauf','','','',' ','','','',''); - INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3883,'file','class','overflow_characteristic','overflow_characteristic','','Ueberlaufcharakteristik','','CARACTERISTIQUES_DEVERSOIR','','zzz_Ueberlaufcharakteristik','','','',' ','','','',''); + INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3883,'file','class','overflow_char','overflow_char','','Ueberlaufcharakteristik','','CARACTERISTIQUES_DEVERSOIR','','zzz_Ueberlaufcharakteristik','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3884,'file','class','shore','shore','','Ufer','','RIVE','','zzz_Ufer','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3885,'file','class','accident','accident','','Unfall','','ACCIDENT','','zzz_Unfall','','','',' ','','','',''); INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3886,'file','class','inspection','inspection','','Untersuchung','','EXAMEN','','zzz_Untersuchung','','','',' ','','','',''); diff --git a/delta/delta_1.6.1_dss_rename_xxx_fk_overflow_characteristic_to_fk_overflow_char.sql b/delta/delta_1.6.1_dss_rename_xxx_fk_overflow_characteristic_to_fk_overflow_char.sql new file mode 100644 index 000000000..74f413bd9 --- /dev/null +++ b/delta/delta_1.6.1_dss_rename_xxx_fk_overflow_characteristic_to_fk_overflow_char.sql @@ -0,0 +1,156 @@ +-- drop connected views not needed as already listed in https://github.com/QGEP/datamodel/blob/master/view/drop_views.sql + +-- class overflow +--1. add correct fk_overflow_char +ALTER TABLE IF EXISTS qgep_od.overflow ADD COLUMN fk_overflow_char varchar (16); + +-- 2. add correct CONSTRAINT +-- ALTER TABLE qgep_od.overflow ADD COLUMN fk_overflow_characteristic varchar (16); +--ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_overflow_characteristic FOREIGN KEY (fk_overflow_characteristic) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE set null; + +ALTER TABLE qgep_od.overflow ADD CONSTRAINT rel_overflow_overflow_char FOREIGN KEY (fk_overflow_char) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE set null; + +--3. copy data from fk_overflow_characteristic to fk_overflow_char +UPDATE qgep_od.overflow +SET fk_overflow_char = fk_overflow_characteristic; + +-- 4. delete old rel_overflow_overflow_characteristic constraint +ALTER TABLE IF EXISTS qgep_od.overflow DROP CONSTRAINT rel_overflow_overflow_characteristic; + +-- 5. delete wrong fk_overflow_characteristic column +ALTER TABLE IF EXISTS qgep_od.overflow DROP COLUMN fk_overflow_characteristic; + +-- 6. rename wrong value in qgep_sys.dictionary_od_field +-- not needed as fk_attributes are not in qgep_sys tables + + +-- class hq_relation +--1. add correct fk_overflow_char +ALTER TABLE IF EXISTS qgep_od.hq_relation ADD COLUMN fk_overflow_char varchar (16); + +-- 2. add correct CONSTRAINT +--ALTER TABLE qgep_od.hq_relation ADD COLUMN fk_overflow_characteristic varchar (16); +--ALTER TABLE qgep_od.hq_relation ADD CONSTRAINT rel_hq_relation_overflow_characteristic FOREIGN KEY (fk_overflow_characteristic) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE cascade; + +ALTER TABLE qgep_od.hq_relation ADD CONSTRAINT rel_hq_relation_overflow_char FOREIGN KEY (fk_overflow_char) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE cascade; + + +--3. copy data from fk_overflow_characteristic to fk_overflow_char +UPDATE qgep_od.hq_relation +SET fk_overflow_char = fk_overflow_characteristic; + +-- 4. delete old rel_overflow_overflow_characteristic constraint +ALTER TABLE IF EXISTS qgep_od.hq_relation DROP CONSTRAINT rel_hq_relation_overflow_characteristic; + +-- 5. delete wrong fk_overflow_characteristic column +ALTER TABLE IF EXISTS qgep_od.hq_relation DROP COLUMN fk_overflow_characteristic; + +-- 6. rename wrong value in qgep_sys.dictionary_od_field +-- not needed as fk_attributes are not in qgep_sys tables + + +-- class hydraulic_char_data +--1. add correct fk_overflow_char +ALTER TABLE IF EXISTS qgep_od.hydraulic_char_data ADD COLUMN fk_overflow_char varchar (16); + +-- 2. add correct CONSTRAINT +--ALTER TABLE qgep_od.hydraulic_char_data ADD COLUMN fk_overflow_characteristic varchar (16); +--ALTER TABLE qgep_od.hydraulic_char_data ADD CONSTRAINT rel_hydraulic_char_data_overflow_characteristic FOREIGN KEY (fk_overflow_characteristic) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE cascade; + +ALTER TABLE qgep_od.hydraulic_char_data ADD CONSTRAINT rel_hydraulic_char_data_overflow_char FOREIGN KEY (fk_overflow_char) REFERENCES qgep_od.overflow_char(obj_id) ON UPDATE CASCADE ON DELETE cascade; + + +--3. copy data from fk_overflow_characteristic to fk_overflow_char +UPDATE qgep_od.hydraulic_char_data +SET fk_overflow_char = fk_overflow_characteristic; + +-- 4. delete old rel_overflow_overflow_characteristic constraint +ALTER TABLE IF EXISTS qgep_od.hydraulic_char_data DROP CONSTRAINT rel_hydraulic_char_data_overflow_characteristic; + +-- 5. delete wrong fk_overflow_characteristic column +ALTER TABLE IF EXISTS qgep_od.hydraulic_char_data DROP COLUMN fk_overflow_characteristic; + +-- 6. rename wrong value in qgep_sys.dictionary_od_field +-- not needed as fk_attributes are not in qgep_sys tables + + +-- class overflow_char +-- 1. rename attribute kind_overflow_characteristic and overflow_characteristic_digital in table qgep_od.overflow_char +-- https://www.postgresqltutorial.com/postgresql-tutorial/postgresql-rename-column/ + +ALTER TABLE qgep_od.overflow_char +RENAME COLUMN kind_overflow_characteristic TO kind_overflow_char; + +ALTER TABLE qgep_od.overflow_char +RENAME COLUMN overflow_characteristic_digital TO overflow_char_digital; + + + + +-- 2. rename qgep_vl.overflow_char_kind_overflow_characteristic to overflow_char_kind_overflow_char +--and qgep_vl.overflow_char_overflow_characteristic_digital to overflow_char_overflow_char_digital +ALTER TABLE qgep_vl.overflow_char_kind_overflow_characteristic RENAME TO overflow_char_kind_overflow_char; + +ALTER TABLE qgep_vl.overflow_char_overflow_characteristic_digital RENAME TO overflow_char_overflow_char_digital; + +-- 3. delete primary constraint of vl_list tables neu 5.10.2023 - geht nicht wegen dependencies +-- use rename instead ALTER TABLE name RENAME CONSTRAINT constraint_name TO new_constraint_name; +--ALTER TABLE IF EXISTS qgep_vl.overflow_char_kind_overflow_characteristic DROP CONSTRAINT pkey_qgep_vl_overflow_char_kind_overflow_characteristic_code; + +ALTER TABLE qgep_vl.overflow_char_kind_overflow_char RENAME CONSTRAINT pkey_qgep_vl_overflow_char_kind_overflow_characteristic_code TO pkey_qgep_vl_overflow_char_kind_overflow_char_code; + +--ALTER TABLE IF EXISTS qgep_vl.overflow_char_overflow_characteristic_digital DROP CONSTRAINT pkey_qgep_vl_overflow_char_overflow_characteristic_digital_code; + +ALTER TABLE qgep_vl.overflow_char_overflow_char_digital RENAME CONSTRAINT pkey_qgep_vl_overflow_char_overflow_characteristic_digital_code TO pkey_qgep_vl_overflow_char_overflow_char_digital_code; + +-- 4. re-add primary key constraint neu 5.10.2023 +-- not needed anymore +--ALTER TABLE qgep_vl.overflow_char_kind_overflow_char ADD CONSTRAINT pkey_qgep_vl_overflow_char_kind_overflow_char_code PRIMARY KEY (code); +--ALTER TABLE qgep_vl.overflow_char_overflow_char_digital ADD CONSTRAINT pkey_qgep_vl_overflow_char_overflow_char_digital_code PRIMARY KEY (code); + + + +-- 6. rename wrong value in qgep_sys.dictionary_od_field + +-- adjust value list in dictionary_od_field +-- INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,6219,'overflow_char','kind_overflow_characteristic','kind_overflow_characteristic','Kennlinie_Typ','GENRE_COURBE_DE_FONCTIONNEMENT','curva_caratteristica_tipo','tipul_curbei_de_func?ionare','yyy_Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben.','Die Kennlinie ist als Q /Q- (bei Bodenöffnungen) oder als H/Q-Tabelle (bei Streichwehren) zu dokumentieren. Bei einer freien Aufteilung muss die Kennlinie nicht dokumentiert werden. Bei Abflussverhältnissen in Einstaubereichen ist die Funktion separat in einer Beilage zu beschreiben.','La courbe est à documenter sous forme de rapport Q/Q (Leaping weir) ou H/Q (déversoir latéral). Les conditions d’écoulement dans la chambre d’accumulation sont à fournir en annexe.','NULL','[CHF]',ARRAY['GEP_Verband','PAA']::qgep_od.plantype[],'true','integer','','','','','','','','','','',NULL,NULL); + + +UPDATE qgep_sys.dictionary_od_field +SET field_name = 'kind_overflow_char', + field_name_en = 'kind_overflow_char' +WHERE (table_name = 'overflow_char' AND field_name = 'kind_overflow_characteristic' AND field_name_en = 'kind_overflow_characteristic') +RETURNING *; + +-- INSERT INTO qgep_sys.dictionary_od_field (class_id, attribute_id, table_name, field_name, field_name_en, field_name_de, field_name_fr, field_name_it, field_name_ro, field_description_en, field_description_de, field_description_fr, field_description_it, field_description_ro, field_mandatory, field_visible, field_datatype, field_unit_en, field_unit_description_en, field_unit_de, field_unit_description_de, field_unit_fr, field_unit_description_fr, field_unit_it, field_unit_description_it, field_unit_ro, field_unit_description_ro, field_max, field_min) VALUES (64,6222,'overflow_char','overflow_characteristic_digital','overflow_characteristic_digital','Kennlinie_digital','COURBE_DE_FONCTIONNEMENT_NUM','curva_caratteristica_digitale','curba_de_func?ionare_numerica','yyy_Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in Ueberlaufcharakteristik ausgefüllt sein in HQ_Relation.','Falls Kennlinie_digital = ja müssen die Attribute für die Q-Q oder H-Q Beziehung in HQ_Relation ausgefüllt sein.','Si courbe de fonctionnement numérique = oui, les attributs pour les relations Q-Q et H-Q doivent être saisis dans la classe RELATION_HQ.','NULL','',ARRAY['GEP_Verband','PAA']::qgep_od.plantype[],'true','integer','','','','','','','','','','',NULL,NULL); + +UPDATE qgep_sys.dictionary_od_field +SET field_name = 'overflow_char_digital', + field_name_en = 'overflow_char_digital' +WHERE (table_name = 'overflow_char' AND field_name = 'overflow_characteristic_digital' AND field_name_en = 'overflow_characteristic_digital') +RETURNING *; + + +-- 4. rename wrong value in qgep_sys.dictionary_od_values +-- INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6219,6220,'overflow_char','kind_overflow_characteristic','hq','hq','','HQ','','HQ','','HQ','','','','yyy_H-Q Beziehung: Hoehe (H) und Durchfluss (Q) Richtung ARA abfüllen','H-Q Beziehung: Hoehe (H) und Durchfluss (Q) Richtung ARA abfüllen','ligne H / Q: H = hauteur d’eau lors du déversement [m.s.m.], Q = débit conservé vers STEP [l/s]','Assegnare altezza (H) e portata (Q)',''); + +UPDATE qgep_sys.dictionary_od_values +SET field_name = 'kind_overflow_char' +WHERE (table_name = 'overflow_char' AND field_name = 'kind_overflow_characteristic') +RETURNING *; + +--INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (64,6222,6223,'overflow_char','overflow_characteristic_digital','yes','yes','','ja','','oui','','si','','','','','','','',''); + +UPDATE qgep_sys.dictionary_od_values +SET field_name = 'overflow_char_digital' +WHERE (table_name = 'overflow_char' AND field_name = 'overflow_characteristic_digital') +RETURNING *; + + + --INSERT INTO qgep_sys.dictionary_od_values (class_id, attribute_id, value_id, table_name, field_name, value_name, value_name_en, shortcut_en, value_name_de, shortcut_de, value_name_fr, shortcut_fr, value_name_it, shortcut_it, value_name_ro, shortcut_ro, value_description_en, value_description_de, value_description_fr, value_description_it, value_description_ro) VALUES (3754,3764,3883,'file','class','overflow_char','overflow_char','','Ueberlaufcharakteristik','','CARACTERISTIQUES_DEVERSOIR','','zzz_Ueberlaufcharakteristik','','','',' ','','','',''); + +UPDATE qgep_sys.dictionary_od_values +SET value_name = 'overflow_char', + value_name_en = 'overflow_char' +WHERE (table_name = 'file' AND field_name = 'class') +RETURNING *; \ No newline at end of file diff --git a/scripts/dispatch_table_migration/README.md b/scripts/dispatch_table_migration/README.md index 85d401fd3..f2ac0893e 100644 --- a/scripts/dispatch_table_migration/README.md +++ b/scripts/dispatch_table_migration/README.md @@ -36,11 +36,11 @@ To perform the migration: ## Technical details * table renames * hydraulic_characteristic_data to hydraulic_char_data - * overflow_characteristic_kind_overflow_characteristic to overflow_char_kind_overflow_characteristic - * overflow_characteristic_overflow_characteristic_digital to overflow_char_overflow_characteristic_digital + * overflow_characteristic_kind_overflow_characteristic to overflow_char_kind_overflow_char + * overflow_characteristic_overflow_characteristic_digital to overflow_char_overflow_char_digital * column renames * in table catchment_area_text, fk_catchment to fk_catchment_area - * in tables hq_relation, hydraulic_char_data and overflow: fk_overflow_char to fk_overflow_characteristic + * in tables hq_relation, hydraulic_char_data and overflow: fk_overflow_characteristic to fk_overflow_char * columns addition (missing in former models) * in table txt_symbol, skip fk_wastewater_structure * in table txt_text, skip fk_wastewater_structure, fk_catchment_area, fk_reach diff --git a/scripts/dispatch_table_migration/migrate_dispatch_copy_data.sql b/scripts/dispatch_table_migration/migrate_dispatch_copy_data.sql index d3d2f6e76..97ebcda6e 100644 --- a/scripts/dispatch_table_migration/migrate_dispatch_copy_data.sql +++ b/scripts/dispatch_table_migration/migrate_dispatch_copy_data.sql @@ -86,8 +86,8 @@ BEGIN IF _loop_count = 0 THEN -- Missing renames _destination_table_name := regexp_replace(_destination_table_name,'^hydraulic_characteristic_data','hydraulic_char_data'); - _destination_table_name := regexp_replace(_destination_table_name,'^overflow_characteristic_kind_overflow_characteristic','overflow_char_kind_overflow_characteristic'); - _destination_table_name := regexp_replace(_destination_table_name,'^overflow_characteristic_overflow_characteristic_digital','overflow_char_overflow_characteristic_digital'); + _destination_table_name := regexp_replace(_destination_table_name,'^overflow_characteristic_kind_overflow_characteristic','overflow_char_kind_overflow_char'); + _destination_table_name := regexp_replace(_destination_table_name,'^overflow_characteristic_overflow_characteristic_digital','overflow_char_overflow_char_digital'); _loop_count = 1; CONTINUE; END IF; @@ -174,8 +174,8 @@ BEGIN AND sequence_name = '%1$I' $$, _sequence_name ) INTO _sequence_exists; IF _sequence_exists = 0 THEN - _sequence_name_fully_qualified := replace(_sequence_name_fully_qualified,'qgep.seq_od_hydraulic_char_data_oid','qgep.seq_od_hydraulic_characteristic_data_oid'); - _sequence_name_fully_qualified := replace(_sequence_name_fully_qualified,'qgep.seq_od_overflow_char_oid','qgep.seq_od_overflow_characteristic_oid'); + _sequence_name_fully_qualified := replace(_sequence_name_fully_qualified,'qgep.seq_od_hydraulic_characteristic_data_oid','qgep.seq_od_hydraulic_char_data_oid'); + _sequence_name_fully_qualified := replace(_sequence_name_fully_qualified,'qgep.seq_od_overflow_characteristic_oid','qgep.seq_od_overflow_char_oid'); END IF; -- update sequence SELECT nextval(_sequence_name_fully_qualified) INTO _sequence_value; diff --git a/swmm_views/16_vw_swmm_pumps.sql b/swmm_views/16_vw_swmm_pumps.sql index a055f9c2e..53f0dfd7d 100644 --- a/swmm_views/16_vw_swmm_pumps.sql +++ b/swmm_views/16_vw_swmm_pumps.sql @@ -19,12 +19,12 @@ SELECT of.identifier, CASE WHEN oc.obj_id IS NULL --'yes; - THEN 'No curve will be created for this pump, it has no overflow_characteristic' - WHEN vl_oc_dig.vsacode != 6223 --'yes; - THEN 'No curve will be created for this pump, overflow_characteristic_digital not equal to yes' - WHEN vl_oc_ki.vsacode != 6220 --'hq; - THEN concat(pu.obj_id, 'No curve will be created for this pump, kind_overflow_characteristic is not equal to H/Q, Q/Q relations are not supported by SWMM') - ELSE NULL + THEN 'No curve will be created for this pump, it has no overflow_char' + WHEN vl_oc_dig.vsacode != 6223 --'yes; + THEN 'No curve will be created for this pump, overflow_char_digital not equal to yes' + WHEN vl_oc_ki.vsacode != 6220 --'hq; + THEN concat(pu.obj_id, 'No curve will be created for this pump, kind_overflow_char is not equal to H/Q, Q/Q relations are not supported by SWMM') + ELSE NULL END ) as description, pu.obj_id::varchar as tag, @@ -38,12 +38,12 @@ SELECT END as hierarchy, wn.obj_id as obj_id FROM qgep_od.pump pu -LEFT JOIN qgep_od.overflow of ON pu.obj_id = of.obj_id -LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic + LEFT JOIN qgep_od.overflow of ON pu.obj_id = of.obj_id + LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vl_oc_dig ON oc.overflow_char_digital = vl_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vl_oc_ki ON oc.kind_overflow_char = vl_oc_ki.code + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959); diff --git a/swmm_views/18_vw_swmm_storages.sql b/swmm_views/18_vw_swmm_storages.sql index 4094764ae..ae0213f74 100644 --- a/swmm_views/18_vw_swmm_storages.sql +++ b/swmm_views/18_vw_swmm_storages.sql @@ -176,14 +176,14 @@ SELECT END as hierarchy, wn.obj_id as obj_id FROM qgep_od.prank_weir pw -LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id -LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vL_oc_ki ON oc.kind_overflow_characteristic = vL_oc_ki.code -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic + LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id + LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vl_oc_dig ON oc.overflow_char_digital = vl_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vL_oc_ki ON oc.kind_overflow_char = vL_oc_ki.code + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959) -AND vl_oc_dig.vsacode = 6223 --'yes; -AND vL_oc_ki.vsacode = 6220; -- h/q relations (Q/Q relations are not supported by SWMM) + AND vl_oc_dig.vsacode = 6223 --'yes; + AND vL_oc_ki.vsacode = 6220; -- h/q relations (Q/Q relations are not supported by SWMM) diff --git a/swmm_views/19_vw_swmm_outlets.sql b/swmm_views/19_vw_swmm_outlets.sql index 2c507a1c6..c9b95b64e 100644 --- a/swmm_views/19_vw_swmm_outlets.sql +++ b/swmm_views/19_vw_swmm_outlets.sql @@ -19,14 +19,14 @@ SELECT END as hierarchy, wn.obj_id as obj_id FROM qgep_od.prank_weir pw -LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id -LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vL_oc_dig ON oc.overflow_characteristic_digital = vL_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic + LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id + LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vL_oc_dig ON oc.overflow_char_digital = vL_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vl_oc_ki ON oc.kind_overflow_char = vl_oc_ki.code + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959) -AND vL_oc_dig.vsacode = 6223 --'yes; -AND vl_oc_ki.vsacode = 6220; -- h/q relations (Q/Q relations are not supported by SWMM) + AND vL_oc_dig.vsacode = 6223 --'yes; + AND vl_oc_ki.vsacode = 6220; -- h/q relations (Q/Q relations are not supported by SWMM) diff --git a/swmm_views/21_vw_swmm_weirs.sql b/swmm_views/21_vw_swmm_weirs.sql index a994d478a..48f81cbe0 100644 --- a/swmm_views/21_vw_swmm_weirs.sql +++ b/swmm_views/21_vw_swmm_weirs.sql @@ -26,16 +26,17 @@ SELECT wn.obj_id as obj_id, NULL as message FROM qgep_od.prank_weir pw -LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id -LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON wn._status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=wn._function_hierarchic + LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id + LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vl_oc_dig ON oc.overflow_char_digital = vl_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vl_oc_ki ON oc.kind_overflow_char = vl_oc_ki.code + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959) -AND (vl_oc_dig.vsacode != 6223 OR vl_oc_dig.vsacode IS NULL) --'yes; -OR (vl_oc_ki.vsacode != 6220 OR vl_oc_ki.vsacode IS NULL)-- h/q relations (Q/Q relations are not supported by SWMM) + AND (vl_oc_dig.vsacode != 6223 OR vl_oc_dig.vsacode IS NULL) --'yes; + OR (vl_oc_ki.vsacode != 6220 OR vl_oc_ki.vsacode IS NULL)-- h/q relations (Q/Q relations are not supported by SWMM) UNION ALL @@ -65,11 +66,12 @@ SELECT wn.obj_id as obj_id, concat('Leaping weirs are not supported by SWMM, ', lw.obj_id, 'see: https://swmm5.org/2013/07/19/leaping-weir-example-in-swmm-5-and-infoswmm-alternative/') as message FROM qgep_od.leapingweir lw -LEFT JOIN qgep_od.overflow of ON lw.obj_id = of.obj_id -LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON wn._status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=wn._function_hierarchic + LEFT JOIN qgep_od.overflow of ON lw.obj_id = of.obj_id + LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vl_oc_dig ON oc.overflow_char_digital = vl_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vl_oc_ki ON oc.kind_overflow_char = vl_oc_ki.code + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959); diff --git a/swmm_views/22_vw_swmm_curves.sql b/swmm_views/22_vw_swmm_curves.sql index ba13daea0..afaf31e10 100644 --- a/swmm_views/22_vw_swmm_curves.sql +++ b/swmm_views/22_vw_swmm_curves.sql @@ -23,19 +23,19 @@ CREATE OR REPLACE VIEW qgep_swmm.vw_curves AS END as hierarchy, wn.obj_id as obj_id FROM qgep_od.hq_relation hq -LEFT JOIN qgep_od.overflow_char oc ON hq.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code -LEFT JOIN qgep_od.overflow of ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_od.pump pu ON pu.obj_id = of.obj_id -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic + LEFT JOIN qgep_od.overflow_char oc ON hq.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vl_oc_dig ON oc.overflow_char_digital = vl_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vl_oc_ki ON oc.kind_overflow_char = vl_oc_ki.code + LEFT JOIN qgep_od.overflow of ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_od.pump pu ON pu.obj_id = of.obj_id + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959) -AND vl_oc_dig.vsacode = 6223 --'yes; -AND vl_oc_ki.vsacode = 6220 -- h/q relations (Q/Q relations are not supported by SWMM) -AND pu.obj_id IS NOT NULL + AND vl_oc_dig.vsacode = 6223 --'yes; + AND vl_oc_ki.vsacode = 6220 -- h/q relations (Q/Q relations are not supported by SWMM) + AND pu.obj_id IS NOT NULL ORDER BY pu.obj_id, hq.altitude) UNION ALL @@ -60,19 +60,19 @@ UNION ALL END as hierarchy, wn.obj_id as obj_id FROM qgep_od.hq_relation hq -LEFT JOIN qgep_od.overflow_char oc ON hq.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_vl.overflow_char_overflow_characteristic_digital vl_oc_dig ON oc.overflow_characteristic_digital = vl_oc_dig.code -LEFT JOIN qgep_vl.overflow_char_kind_overflow_characteristic vl_oc_ki ON oc.kind_overflow_characteristic = vl_oc_ki.code -LEFT JOIN qgep_od.overflow of ON of.fk_overflow_characteristic = oc.obj_id -LEFT JOIN qgep_od.prank_weir pw ON pw.obj_id = of.obj_id -LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node -LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id -LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code -LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic + LEFT JOIN qgep_od.overflow_char oc ON hq.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_vl.overflow_char_overflow_char_digital vl_oc_dig ON oc.overflow_char_digital = vl_oc_dig.code + LEFT JOIN qgep_vl.overflow_char_kind_overflow_char vl_oc_ki ON oc.kind_overflow_char = vl_oc_ki.code + LEFT JOIN qgep_od.overflow of ON of.fk_overflow_char = oc.obj_id + LEFT JOIN qgep_od.prank_weir pw ON pw.obj_id = of.obj_id + LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node + LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id + LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code + LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959) -AND vl_oc_dig.vsacode = 6223 --'yes; -AND vl_oc_ki.vsacode = 6220 -- h/q relations (Q/Q relations are not supported by SWMM) -AND pw.obj_id IS NOT NULL + AND vl_oc_dig.vsacode = 6223 --'yes; + AND vl_oc_ki.vsacode = 6220 -- h/q relations (Q/Q relations are not supported by SWMM) + AND pw.obj_id IS NOT NULL ORDER BY pw.obj_id, hq.altitude) UNION ALL diff --git a/swmm_views/23_vw_swmm_xsections.sql b/swmm_views/23_vw_swmm_xsections.sql index a98d299eb..84da065c1 100644 --- a/swmm_views/23_vw_swmm_xsections.sql +++ b/swmm_views/23_vw_swmm_xsections.sql @@ -81,13 +81,13 @@ SELECT wn.obj_id as obj_id FROM qgep_od.prank_weir pw LEFT JOIN qgep_od.overflow of ON pw.obj_id = of.obj_id -LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_characteristic = oc.obj_id +LEFT JOIN qgep_od.overflow_char oc ON of.fk_overflow_char = oc.obj_id LEFT JOIN qgep_od.wastewater_node wn ON wn.obj_id = of.fk_wastewater_node LEFT JOIN qgep_od.wastewater_structure ws ON ws.fk_main_wastewater_node = wn.obj_id LEFT JOIN qgep_vl.wastewater_structure_status ws_st ON ws.status = ws_st.code LEFT JOIN qgep_vl.channel_function_hierarchic cfhi ON cfhi.code=ws._function_hierarchic WHERE ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959) -AND oc.overflow_characteristic_digital != 6223 --'NO or unknown; -OR oc.kind_overflow_characteristic != 6220 -- Q/Q relation or unknown -AND ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959); + AND oc.overflow_char_digital != 6223 --'NO or unknown; + OR oc.kind_overflow_char != 6220 -- Q/Q relation or unknown + AND ws_st.vsacode IN (6530, 6533, 8493, 6529, 6526, 7959);