diff --git a/docs/en_US/release_notes_5_2.rst b/docs/en_US/release_notes_5_2.rst index fe8d3bd10..5b879dc3c 100644 --- a/docs/en_US/release_notes_5_2.rst +++ b/docs/en_US/release_notes_5_2.rst @@ -20,5 +20,6 @@ Bug fixes | `Issue #5519 `_ - Ensure that the query tool tab should be closed after server disconnection when auto-commit/auto-rollback is set to false. | `Issue #6293 `_ - Fixed an issue where the procedure creation is failed when providing the Volatility option. +| `Issue #6327 `_ - Ensure that while comparing domains check function dependencies should be considered in schema diff. | `Issue #6344 `_ - Fixed cannot unpack non-iterable response object error when selecting any partition. | `Issue #6356 `_ - Mark the Apache HTTPD config file as such in the web DEB and RPM packages. diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py index da906f676..382e9bc3c 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/domains/__init__.py @@ -982,6 +982,37 @@ AND relkind != 'c'))""" json_resp=False) return sql + def get_dependencies(self, conn, object_id, where=None, + show_system_objects=None, is_schema_diff=False): + """ + This function is used to get dependencies of domain and it's + domain constraints. + """ + domain_dependencies = [] + domain_deps = super().get_dependencies( + conn, object_id, where=None, show_system_objects=None, + is_schema_diff=True) + if len(domain_deps) > 0: + domain_dependencies.extend(domain_deps) + + # Get Domain Constraints + SQL = render_template("/".join([self.template_path, + self._GET_CONSTRAINTS_SQL]), + doid=object_id) + status, res = self.conn.execute_dict(SQL) + if not status: + return False, internal_server_error(errormsg=res) + + # Get the domain constraints dependencies. + for row in res['rows']: + constraint_deps = super().get_dependencies( + conn, row['conoid'], where=None, show_system_objects=None, + is_schema_diff=True) + if len(constraint_deps) > 0: + domain_dependencies.extend(constraint_deps) + + return domain_dependencies + SchemaDiffRegistry(blueprint.node_type, DomainView) DomainView.register_node_view(blueprint)