diff --git a/migrator/migrator.go b/migrator/migrator.go index eafe7bb29..376145998 100644 --- a/migrator/migrator.go +++ b/migrator/migrator.go @@ -445,7 +445,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy } } - if !isSameType { + if !isSameType && fullDataType != "mediumtext" && fullDataType != "longtext" { // check size if length, ok := columnType.Length(); length != int64(field.Size) { if length > 0 && field.Size > 0 { @@ -477,14 +477,6 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy } } - // check unique - if unique, ok := columnType.Unique(); ok && unique != field.Unique { - // not primary key - if !field.PrimaryKey { - alterColumn = true - } - } - // check default value if !field.PrimaryKey { currentDefaultNotNull := field.HasDefaultValue && !strings.EqualFold(field.DefaultValue, "NULL")