fix(Migrate): add unique and index for new columns

This commit is contained in:
Saif Ur Rehman 2021-12-31 13:30:02 +05:00
parent 39097b05a7
commit 063cc293a9

View file

@ -206,6 +206,12 @@ class DbColumn:
if not current_def:
self.fieldname = validate_column_name(self.fieldname)
self.table.add_column.append(self)
if column_type not in ('text', 'longtext'):
if self.unique:
self.table.add_unique.append(self)
if self.set_index:
self.table.add_index.append(self)
return
# type