brotherton-erpnext/patches/1311/p02_index_singles.py

11 lines
453 B
Python
Raw Normal View History

2013-11-20 07:29:58 +00:00
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
2013-11-15 10:39:45 +00:00
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
2013-11-15 10:39:45 +00:00
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`)""")