migrator.go -> MigrateColumn.
// check unique, if column has "uniqueIndex" tag, it's unique = true.
This commit is contained in:
parent
2c13ea008e
commit
286e4ea884
@ -440,7 +440,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy
|
||||
}
|
||||
|
||||
// check unique
|
||||
if unique, ok := columnType.Unique(); ok && unique != field.Unique {
|
||||
if unique, ok := columnType.Unique(); ok && !(unique == field.Unique || field.UniqueIndex == unique) {
|
||||
// not primary key
|
||||
if !field.PrimaryKey {
|
||||
alterColumn = true
|
||||
|
Loading…
x
Reference in New Issue
Block a user