fix: create index if it doesn't exist
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
parent
5441658b39
commit
0fab9a0bc8
1 changed files with 1 additions and 1 deletions
|
|
@ -125,7 +125,7 @@ class SQLiteTable(DBTable):
|
|||
if self.meta.sort_field == "modified" and not frappe.db.get_column_index(
|
||||
self.table_name, "modified", unique=False
|
||||
):
|
||||
index_queries.append(f"CREATE INDEX `modified` ON `{self.table_name}` (`modified`)")
|
||||
index_queries.append(f"CREATE INDEX IF NOT EXISTS `modified` ON `{self.table_name}` (`modified`)")
|
||||
|
||||
for query in index_queries:
|
||||
frappe.db.sql_ddl(query)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue