Rushabh Mehta | ad45e31 | 2013-11-20 12:59:58 +0530 | [diff] [blame] | 1 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors |
Rushabh Mehta | 154c857 | 2013-11-15 16:09:45 +0530 | [diff] [blame] | 2 | # License: GNU General Public License v3. See license.txt |
Anand Doshi | 2b71380 | 2013-11-16 12:33:34 +0530 | [diff] [blame] | 3 | from __future__ import unicode_literals |
Rushabh Mehta | 154c857 | 2013-11-15 16:09:45 +0530 | [diff] [blame] | 4 | |
| 5 | def execute(): |
| 6 | import webnotes |
| 7 | if not webnotes.conn.sql("""show index from `tabSingles` |
| 8 | where Key_name="singles_doctype_field_index" """): |
| 9 | webnotes.conn.commit() |
| 10 | webnotes.conn.sql("""alter table `tabSingles` |
| 11 | add index singles_doctype_field_index(`doctype`, `field`)""") |