brotherton-erpnext/patches/1311/p02_index_singles.py
2013-11-15 16:09:45 +05:30

10 lines
396 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd.
# License: GNU General Public License v3. See license.txt
def execute():
import webnotes
if not webnotes.conn.sql("""show index from `tabSingles`
where Key_name="singles_doctype_field_index" """):
webnotes.conn.commit()
webnotes.conn.sql("""alter table `tabSingles`
add index singles_doctype_field_index(`doctype`, `field`)""")