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:
Akshay Joshi
2024-05-21 16:04:25 +05:30
parent dd45f06d50
commit 6c7bc1c815
13 changed files with 24 additions and 11 deletions

View File

@@ -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'])

View File

@@ -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