diff --git a/migrator/migrator.go b/migrator/migrator.go index 084d430f..a475d307 100644 --- a/migrator/migrator.go +++ b/migrator/migrator.go @@ -381,7 +381,7 @@ func (m Migrator) MigrateColumn(value interface{}, field *schema.Field, columnTy // check precision if precision, _, ok := columnType.DecimalSize(); ok && int64(field.Precision) != precision { - if strings.Contains(m.DataTypeOf(field), fmt.Sprint(field.Precision)) { + if regexp.MustCompile(fmt.Sprintf("[^0-9]%d[^0-9]", field.Precision)).MatchString(m.DataTypeOf(field)) { alterColumn = true } }