Skip to content

Commit

Permalink
Merge pull request #189 from rbovard/new-views
Browse files Browse the repository at this point in the history
Create `vw_infiltration_installation` and `vw_wwtp_structure` views
  • Loading branch information
ponceta authored Dec 6, 2022
2 parents 2bbb1f4 + 134e18c commit e94fef6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 4 additions & 2 deletions view/create_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def create_views(srid: int,
SingleInheritance('qgep_od.wastewater_structure', 'qgep_od.manhole', view_name='vw_manhole', pg_service=pg_service).create()
SingleInheritance('qgep_od.wastewater_structure', 'qgep_od.discharge_point', view_name='vw_discharge_point', pg_service=pg_service).create()
SingleInheritance('qgep_od.wastewater_structure', 'qgep_od.special_structure', view_name='vw_special_structure', pg_service=pg_service).create()
SingleInheritance('qgep_od.wastewater_structure', 'qgep_od.infiltration_installation', view_name='vw_infiltration_installation', pg_service=pg_service).create()
SingleInheritance('qgep_od.wastewater_structure', 'qgep_od.wwtp_structure', view_name='vw_wwtp_structure', pg_service=pg_service).create()

SingleInheritance('qgep_od.wastewater_networkelement', 'qgep_od.reach', view_name='vw_reach', pg_service=pg_service).create()
SingleInheritance('qgep_od.wastewater_networkelement', 'qgep_od.wastewater_node', view_name='vw_wastewater_node', pkey_default_value=True, pg_service=pg_service).create()
Expand All @@ -63,9 +65,9 @@ def create_views(srid: int,

vw_qgep_wastewater_structure(srid, pg_service=pg_service, extra_definition=qgep_wastewater_structure_extra)
vw_qgep_reach(pg_service=pg_service, extra_definition=qgep_reach_extra)

run_sql('view/vw_file.sql', pg_service, variables)

MultipleInheritance(safe_load(open("view/vw_oo_overflow.yaml")), create_joins=True, variables=variables, pg_service=pg_service, drop=True).create()
MultipleInheritance(safe_load(open("view/vw_oo_organisation.yaml")), drop=True, pg_service=pg_service).create()

Expand Down
6 changes: 6 additions & 0 deletions view/drop_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ DROP FUNCTION IF EXISTS qgep_od.vw_discharge_point_insert();
DROP VIEW IF EXISTS qgep_od.vw_special_structure;
DROP FUNCTION IF EXISTS qgep_od.vw_special_structure_insert();

DROP VIEW IF EXISTS qgep_od.vw_infiltration_installation;
DROP FUNCTION IF EXISTS qgep_od.vw_infiltration_installation_insert();

DROP VIEW IF EXISTS qgep_od.vw_wwtp_structure;
DROP FUNCTION IF EXISTS qgep_od.vw_wwtp_structure_insert();


-- wastewater_networkelement
DROP VIEW IF EXISTS qgep_od.vw_reach;
Expand Down

0 comments on commit e94fef6

Please sign in to comment.