Merge pull request #1779 from wenzhixue/patch-1

fix bug for "duplicate key name" when db init
This commit is contained in:
Rushabh Mehta 2016-06-07 10:55:21 +05:30
commit 1210dda852

View file

@ -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