From 01d2e24f4a3e37c0d6a5d541432025c97e73003c Mon Sep 17 00:00:00 2001 From: Hussain Nagaria Date: Fri, 28 Nov 2025 11:48:55 +0530 Subject: [PATCH] chore: patch to drop old index * there is a better covering index now --- frappe/core/doctype/communication/patches/__init__.py | 0 .../doctype/communication/patches/drop_ref_dt_dn_index.py | 8 ++++++++ frappe/patches.txt | 1 + 3 files changed, 9 insertions(+) create mode 100644 frappe/core/doctype/communication/patches/__init__.py create mode 100644 frappe/core/doctype/communication/patches/drop_ref_dt_dn_index.py diff --git a/frappe/core/doctype/communication/patches/__init__.py b/frappe/core/doctype/communication/patches/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/frappe/core/doctype/communication/patches/drop_ref_dt_dn_index.py b/frappe/core/doctype/communication/patches/drop_ref_dt_dn_index.py new file mode 100644 index 0000000000..c1c3fa995b --- /dev/null +++ b/frappe/core/doctype/communication/patches/drop_ref_dt_dn_index.py @@ -0,0 +1,8 @@ +import frappe +from frappe.patches.v14_0.drop_unused_indexes import drop_index_if_exists + + +def execute(): + index_fields = ["reference_doctype", "reference_name"] + index_name = frappe.db.get_index_name(index_fields) + drop_index_if_exists("tabCommunication", index_name) diff --git a/frappe/patches.txt b/frappe/patches.txt index 8113d8db1a..5b076fab59 100644 --- a/frappe/patches.txt +++ b/frappe/patches.txt @@ -251,3 +251,4 @@ frappe.patches.v16_0.add_module_deprecation_warning frappe.patches.v16_0.auto_generate_desktop_icon_and_sidebar frappe.patches.v16_0.add_private_workspaces_to_sidebar frappe.core.doctype.communication_link.patches.copy_communication_date_to_link +frappe.core.doctype.communication.patches.drop_ref_dt_dn_index