Fix check field's precision

This commit is contained in:
Jinzhu 2020-11-25 14:55:53 +08:00
parent 66e8a72bf1
commit 557b874ee3
1 changed files with 1 additions and 1 deletions

View File

@ -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(fullDataType, fmt.Sprint(field.Precision)) {
if strings.Contains(m.DataTypeOf(field), fmt.Sprint(field.Precision)) {
alterColumn = true
}
}