Skip to content

Commit

Permalink
fix: don't add creation index if one exists (#26295) (#26297)
Browse files Browse the repository at this point in the history
(cherry picked from commit f183a31)

Co-authored-by: Ankush Menat <ankush@frappe.io>
  • Loading branch information
mergify[bot] and ankush committed May 2, 2024
1 parent c0f3912 commit c74dcbd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frappe/database/mariadb/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def alter(self):
if not frappe.db.get_column_index(self.table_name, col.fieldname, unique=False):
add_index_query.append(f"ADD INDEX `{col.fieldname}_index`(`{col.fieldname}`)")

if self.meta.sort_field == "creation" and frappe.db.get_column_index(
if self.meta.sort_field == "creation" and not frappe.db.get_column_index(
self.table_name, "creation", unique=False
):
add_index_query.append("ADD INDEX `creation`(`creation`)")
Expand Down

0 comments on commit c74dcbd

Please sign in to comment.