From 557448ac070e4d037963351b7ea2457cd23cad88 Mon Sep 17 00:00:00 2001 From: Daniel Marin Date: Fri, 2 Aug 2024 08:58:45 +0200 Subject: [PATCH] fix(workflow): re order files to execute --- test/execute_sql_files.py | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/test/execute_sql_files.py b/test/execute_sql_files.py index bd0de2e27d..9a5a834a05 100644 --- a/test/execute_sql_files.py +++ b/test/execute_sql_files.py @@ -34,11 +34,11 @@ def connect_to_db(): def main(project_type): print(f"Project type: {project_type}") - + conn = connect_to_db() # Define the root directories to process - root_directories = ["utils", f"{project_type}", "i18n/en_US"] + root_directories = ["utils/ddl", f"{project_type}/schema_model", "utils/fct", "utils/ftrg", f"{project_type}/fct", f"{project_type}/ftrg", "i18n/en_US"] exclude_prefix = "ud_" if project_type == "ws" else "ws_" # Execute SQL files in the root directories @@ -63,19 +63,6 @@ def main(project_type): else: print(f"Directory {updates_dir} does not exist") - # Execute child views - execute_sql_file(conn, f"childviews/en_US/{project_type}_schema_model.sql") - - # Execute last process command - with conn.cursor() as cursor: - lastprocess_command = f""" - SELECT {project_type}_36.gw_fct_admin_schema_lastprocess( - '{{"client":{{"device":4, "lang":"en_US"}}, "data":{{"isNewProject":"TRUE", "gwVersion":"3.6.012", "projectType":"{project_type.upper()}", "epsg":25831, "descript":"{project_type}_36", "name":"{project_type}_36", "author":"postgres", "date":"29-07-2024"}}}}' - ); - """ - cursor.execute(lastprocess_command) - conn.commit() - # Define the example directory example_dir = f"example/user/{project_type}" @@ -89,6 +76,16 @@ def main(project_type): else: print(f"Directory {example_dir} does not exist") + # Execute last process command + with conn.cursor() as cursor: + lastprocess_command = f""" + SELECT {project_type}_36.gw_fct_admin_schema_lastprocess( + '{{"client":{{"device":4, "lang":"en_US"}}, "data":{{"isNewProject":"TRUE", "gwVersion":"3.6.012", "projectType":"{project_type.upper()}", "epsg":25831, "descript":"{project_type}_36", "name":"{project_type}_36", "author":"postgres", "date":"29-07-2024"}}}}' + ); + """ + cursor.execute(lastprocess_command) + conn.commit() + # Close the database connection conn.close()