diff --git a/frappe/model/db_schema.py b/frappe/model/db_schema.py index d71bff45a4..62f0643904 100644 --- a/frappe/model/db_schema.py +++ b/frappe/model/db_schema.py @@ -190,7 +190,7 @@ class DbTable: def get_index_definitions(self): ret = [] for key, col in self.columns.items(): - if col.set_index and col.fieldtype in type_map and \ + if col.set_index and not col.unique and col.fieldtype in type_map and \ type_map.get(col.fieldtype)[0] not in ('text', 'longtext'): ret.append('index `' + key + '`(`' + key + '`)') return ret