From fb66672acd63e3ca43a594d13e6f825e0c033be9 Mon Sep 17 00:00:00 2001 From: Aleksandr Smyslov Date: Thu, 12 Dec 2024 12:57:44 +0100 Subject: [PATCH] fix param --- .../schemas/views/schema_diff_view_utils.py | 2 +- web/pgadmin/tools/schema_diff/__init__.py | 27 ++++++++++++++----- web/pgadmin/tools/schema_diff/compare.py | 2 +- .../tools/schema_diff/directory_compare.py | 2 +- 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/schema_diff_view_utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/schema_diff_view_utils.py index 20d619ffc0e..82758bf24cb 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/views/schema_diff_view_utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/views/schema_diff_view_utils.py @@ -81,7 +81,7 @@ def compare(self, **kwargs): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants + ignore_grants=ignore_grants, ignore_partitions=ignore_partitions) def ddl_compare(self, **kwargs): diff --git a/web/pgadmin/tools/schema_diff/__init__.py b/web/pgadmin/tools/schema_diff/__init__.py index 619ec55a076..da5888f536e 100644 --- a/web/pgadmin/tools/schema_diff/__init__.py +++ b/web/pgadmin/tools/schema_diff/__init__.py @@ -485,6 +485,8 @@ def compare_database(params): ignore_whitespaces = bool(params['ignore_whitespaces']) ignore_tablespace = bool(params['ignore_tablespace']) ignore_grants = bool(params['ignore_grants']) + ignore_partitions = bool(params['ignore_partitions']) + # Fetch all the schemas of source and target database # Compare them and get the status. @@ -514,7 +516,8 @@ def compare_database(params): node_percent=node_percent, ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) comparison_result = \ comparison_result + comparison_schema_result @@ -538,7 +541,8 @@ def compare_database(params): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) comparison_result = \ comparison_result + comparison_schema_result @@ -561,7 +565,8 @@ def compare_database(params): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) comparison_result = \ comparison_result + comparison_schema_result @@ -586,7 +591,8 @@ def compare_database(params): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) comparison_result = \ comparison_result + comparison_schema_result @@ -631,6 +637,8 @@ def compare_schema(params): ignore_whitespaces = bool(params['ignore_whitespaces']) ignore_tablespace = bool(params['ignore_tablespace']) ignore_grants = bool(params['ignore_grants']) + ignore_partitions = bool(params['ignore_partitions']) + all_registered_nodes = SchemaDiffRegistry.get_registered_nodes() node_percent = round(100 / len(all_registered_nodes), 2) total_percent = 0 @@ -651,7 +659,8 @@ def compare_schema(params): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) comparison_result = \ comparison_result + comparison_schema_result @@ -787,6 +796,7 @@ def compare_database_objects(**kwargs): ignore_whitespaces = kwargs.get('ignore_whitespaces') ignore_tablespace = kwargs.get('ignore_tablespace') ignore_grants = kwargs.get('ignore_grants') + ignore_partitions = kwargs.get('ignore_partitions') comparison_result = [] all_registered_nodes = SchemaDiffRegistry.get_registered_nodes(None, @@ -812,7 +822,8 @@ def compare_database_objects(**kwargs): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) if res is not None: comparison_result = comparison_result + res @@ -845,6 +856,7 @@ def compare_schema_objects(**kwargs): ignore_whitespaces = kwargs.get('ignore_whitespaces') ignore_tablespace = kwargs.get('ignore_tablespace') ignore_grants = kwargs.get('ignore_grants') + ignore_partitions = kwargs.get('ignore_partitions') source_schema_name = None if is_schema_source_only: @@ -883,7 +895,8 @@ def compare_schema_objects(**kwargs): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants) + ignore_grants=ignore_grants, + ignore_partitions=ignore_partitions) if res is not None: comparison_result = comparison_result + res diff --git a/web/pgadmin/tools/schema_diff/compare.py b/web/pgadmin/tools/schema_diff/compare.py index 837cfb9038e..9dc1f55901c 100644 --- a/web/pgadmin/tools/schema_diff/compare.py +++ b/web/pgadmin/tools/schema_diff/compare.py @@ -107,7 +107,7 @@ def compare(self, **kwargs): ignore_owner=ignore_owner, ignore_whitespaces=ignore_whitespaces, ignore_tablespace=ignore_tablespace, - ignore_grants=ignore_grants + ignore_grants=ignore_grants, ignore_partitions=ignore_partitions) def ddl_compare(self, **kwargs): diff --git a/web/pgadmin/tools/schema_diff/directory_compare.py b/web/pgadmin/tools/schema_diff/directory_compare.py index 0757e9fbae0..7a13b3fd79d 100644 --- a/web/pgadmin/tools/schema_diff/directory_compare.py +++ b/web/pgadmin/tools/schema_diff/directory_compare.py @@ -493,7 +493,7 @@ def compare_dictionaries(**kwargs): "group_name": group_name, "target_schema": target_schema, "ignore_whitespaces": ignore_whitespaces, - "ignore_grants": ignore_grants + "ignore_grants": ignore_grants, "ignore_partitions": ignore_partitions }