mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that Schema Diff does not indicate a table as different when the trigger names are the same but the trigger function body is different. #5762
This commit is contained in:
@@ -457,6 +457,7 @@ def compare_database(params):
|
||||
This function will compare the two databases.
|
||||
"""
|
||||
# Check the pre validation before compare
|
||||
SchemaDiffRegistry.set_schema_diff_compare_mode('Database Objects')
|
||||
status, error_msg, diff_model_obj, session_obj = \
|
||||
compare_pre_validation(params['trans_id'], params['source_sid'],
|
||||
params['target_sid'])
|
||||
@@ -606,6 +607,7 @@ def compare_schema(params):
|
||||
This function will compare the two schema.
|
||||
"""
|
||||
# Check the pre validation before compare
|
||||
SchemaDiffRegistry.set_schema_diff_compare_mode('Schema Objects')
|
||||
status, error_msg, diff_model_obj, session_obj = \
|
||||
compare_pre_validation(params['trans_id'], params['source_sid'],
|
||||
params['target_sid'])
|
||||
|
||||
@@ -15,6 +15,7 @@ class SchemaDiffRegistry():
|
||||
It is more of a registry for different type of nodes for schema diff.
|
||||
"""
|
||||
_registered_nodes = dict()
|
||||
_schema_diff_compare_mode = None
|
||||
|
||||
def __init__(self, node_name, node_view, parent_node='schema'):
|
||||
if node_name not in SchemaDiffRegistry._registered_nodes:
|
||||
@@ -59,3 +60,11 @@ class SchemaDiffRegistry():
|
||||
if not module:
|
||||
return None
|
||||
return module(**cmd)
|
||||
|
||||
@classmethod
|
||||
def set_schema_diff_compare_mode(cls, mode):
|
||||
cls._schema_diff_compare_mode = mode
|
||||
|
||||
@classmethod
|
||||
def get_schema_diff_compare_mode(cls):
|
||||
return cls._schema_diff_compare_mode
|
||||
|
||||
Reference in New Issue
Block a user