From 83bfdf9b3c1b91ba4384851024d1891c613cb602 Mon Sep 17 00:00:00 2001 From: Akshay Joshi Date: Mon, 28 Nov 2022 17:27:21 +0530 Subject: [PATCH] Fixed an issue where the wrong schema is displayed for a foreign key in the schema diff tool. #5488 --- docs/en_US/release_notes_6_17.rst | 2 ++ .../databases/schemas/tables/constraints/foreign_key/utils.py | 4 ++-- .../servers/databases/schemas/tables/schema_diff_utils.py | 3 ++- web/pgadmin/tools/schema_diff/directory_compare.py | 1 - 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/en_US/release_notes_6_17.rst b/docs/en_US/release_notes_6_17.rst index b9479b5d1..3ba07d78e 100644 --- a/docs/en_US/release_notes_6_17.rst +++ b/docs/en_US/release_notes_6_17.rst @@ -25,7 +25,9 @@ Housekeeping Bug fixes ********* + | `Issue #5488 `_ - Fixed an issue where the wrong schema is displayed for a foreign key in the schema diff tool. | `Issue #5495 `_ - Ensure that the query history date format in Desktop mode matches the format of the locale of the pgadmin server. | `Issue #5505 `_ - Fixed an issue where the CSV file would not download if the CSV quote character length exceeded 1. | `Issue #5513 `_ - Ensure that DATA_DIR dependent folders/files are automatically created inside the specified DATA_DIR if they are not specified separately in the configuration file. | `Issue #5548 `_ - Fixed an issue where editor position was wrong when editing data from result grid. + | `Issue #5575 `_ - Ensure the query tool is launched successfully for the servers registered with the PostgreSQL service. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/utils.py index 75557c199..62b7ea453 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/utils.py @@ -355,8 +355,8 @@ def _checks_for_schema_diff(table, schema, data): if 'remote_schema' not in data: data['remote_schema'] = None - elif 'schema' in data and (schema is None or schema == ''): - data['remote_schema'] = data['schema'] + if 'schema' in data and (schema is None or schema == ''): + data['remote_schema'] = data['schema'] if 'remote_table' not in data: data['remote_table'] = None diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py index a63f7a5d9..7c08c0231 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/schema_diff_utils.py @@ -30,7 +30,8 @@ class SchemaDiffTableCompare(SchemaDiffObjectCompare): constraint_keys_to_ignore = ['relname', 'nspname', 'parent_tbl', 'attrelid', 'adrelid', 'fknsp', 'confrelid', 'references', 'refnsp', 'remote_schema', - 'conkey', 'indkey', 'references_table_name'] + 'conkey', 'indkey', 'references_table_name', + 'refnspoid'] trigger_keys_to_ignore = ['xmin', 'tgrelid', 'tgfoid', 'tfunction', 'tgqual', 'tgconstraint'] diff --git a/web/pgadmin/tools/schema_diff/directory_compare.py b/web/pgadmin/tools/schema_diff/directory_compare.py index 5a3b13082..859635a63 100644 --- a/web/pgadmin/tools/schema_diff/directory_compare.py +++ b/web/pgadmin/tools/schema_diff/directory_compare.py @@ -13,7 +13,6 @@ import copy import string from pgadmin.tools.schema_diff.model import SchemaDiffModel from flask import current_app -from pgadmin.utils.preferences import Preferences from pgadmin.utils.constants import PGADMIN_STRING_SEPARATOR count = 1