perf: Drop name
part from posting sort index (#33551)
This commit is contained in:
parent
59628f1934
commit
8a56df695d
@ -316,6 +316,7 @@ erpnext.patches.v14_0.create_accounting_dimensions_in_subcontracting_doctypes
|
||||
erpnext.patches.v14_0.fix_subcontracting_receipt_gl_entries
|
||||
erpnext.patches.v14_0.migrate_remarks_from_gl_to_payment_ledger
|
||||
erpnext.patches.v13_0.update_schedule_type_in_loans
|
||||
erpnext.patches.v13_0.drop_unused_sle_index_parts
|
||||
erpnext.patches.v14_0.create_accounting_dimensions_for_asset_capitalization
|
||||
erpnext.patches.v14_0.update_partial_tds_fields
|
||||
erpnext.patches.v14_0.create_incoterms_and_migrate_shipment
|
||||
|
14
erpnext/patches/v13_0/drop_unused_sle_index_parts.py
Normal file
14
erpnext/patches/v13_0/drop_unused_sle_index_parts.py
Normal file
@ -0,0 +1,14 @@
|
||||
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()
|
@ -221,14 +221,9 @@ class StockLedgerEntry(Document):
|
||||
|
||||
|
||||
def on_doctype_update():
|
||||
if not frappe.db.has_index("tabStock Ledger Entry", "posting_sort_index"):
|
||||
frappe.db.commit()
|
||||
frappe.db.add_index(
|
||||
"Stock Ledger Entry",
|
||||
fields=["posting_date", "posting_time", "name"],
|
||||
index_name="posting_sort_index",
|
||||
)
|
||||
|
||||
frappe.db.add_index(
|
||||
"Stock Ledger Entry", fields=["posting_date", "posting_time"], index_name="posting_sort_index"
|
||||
)
|
||||
frappe.db.add_index("Stock Ledger Entry", ["voucher_no", "voucher_type"])
|
||||
frappe.db.add_index("Stock Ledger Entry", ["batch_no", "item_code", "warehouse"])
|
||||
frappe.db.add_index("Stock Ledger Entry", ["warehouse", "item_code"], "item_warehouse")
|
||||
|
Loading…
x
Reference in New Issue
Block a user