brotherton-erpnext/erpnext/patches/v13_0/drop_unused_sle_index_parts.py

15 lines
332 B
Python

import frappe
from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import on_doctype_update
def execute():
try:
frappe.db.sql_ddl("ALTER TABLE `tabStock Ledger Entry` DROP INDEX `posting_sort_index`")
except Exception:
frappe.log_error("Failed to drop index")
return
# Recreate indexes
on_doctype_update()