From 514013378fc83bada1bc03f289c63cdb07d25a97 Mon Sep 17 00:00:00 2001 From: SJiB Date: Sat, 11 May 2024 22:22:30 +0200 Subject: [PATCH] Add Refresh materialized views --- qgepqwat2ili/qgepdss/import_.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/qgepqwat2ili/qgepdss/import_.py b/qgepqwat2ili/qgepdss/import_.py index 8f2bab99..5e11af64 100644 --- a/qgepqwat2ili/qgepdss/import_.py +++ b/qgepqwat2ili/qgepdss/import_.py @@ -3819,3 +3819,22 @@ def overflow_common(row): logger.info("symbology triggers successfully created!") post_session.commit() post_session.close() + + #11.5.2024 add post_session2 - to do add queries for main_cover and main_node as in TEKSI, add to symbology functions? or extra create sql? + # see teksi ww https://github.com/teksi/wastewater/blob/3acfba249866d299f8a22e249d9f1e475fe7b88d/datamodel/app/symbology_functions.sql#L290 + + post_session2 = Session(utils.sqlalchemy.create_engine(), autocommit=False, autoflush=False) + + # logger.info("Update wastewater structure fk_main_cover") + # cursor.execute("SELECT tww_app.wastewater_structure_update_fk_main_cover('', True);") + + # logger.info("Update wastewater structure fk_main_wastewater_node") + # cursor.execute( + # "SELECT tww_app.wastewater_structure_update_fk_main_wastewater_node('', True);" + # ) + + logger.info("Refresh materialized views") + cursor.execute("SELECT qgep_network.refresh_network_simple();") + + post_session2.commit() + post_session2.close() \ No newline at end of file