Merge pull request #1779 from wenzhixue/patch-1
fix bug for "duplicate key name" when db init
This commit is contained in:
commit
1210dda852
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue