brotherton-erpnext/patches/1311/p02_index_singles.py
2013-11-20 13:00:28 +05:30

11 lines
453 B
Python

# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
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`)""")