Merge pull request #15484 from MochaTechnologies/migrate-new-column-index

fix(Migrate): add unique and index for new columns
This commit is contained in:
mergify[bot] 2022-01-06 05:54:18 +00:00 committed by GitHub
commit ea5d99b0e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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