Skip to content

Commit

Permalink
fix(MariaDBTable): dont attempt to drop index twice (#19783) (#19801)
Browse files Browse the repository at this point in the history
(cherry picked from commit db9b25e)

Co-authored-by: Sagar Vora <sagar@resilient.tech>
  • Loading branch information
mergify[bot] and sagarvora committed Jan 27, 2023
1 parent 768f67c commit 1b94c62
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 @@ -71,7 +71,7 @@ def alter(self):
if not frappe.db.has_index(self.table_name, col.fieldname + "_index"):
add_index_query.append("ADD INDEX `{}_index`(`{}`)".format(col.fieldname, col.fieldname))

for col in self.drop_index + self.drop_unique:
for col in {*self.drop_index, *self.drop_unique}:
if col.fieldname != "name": # primary key
current_column = self.current_columns.get(col.fieldname.lower())
unique_constraint_changed = current_column.unique != col.unique
Expand Down

0 comments on commit 1b94c62

Please sign in to comment.