mirror of https://github.com/go-gorm/gorm.git
Fix check field's precision
This commit is contained in:
parent
66e8a72bf1
commit
557b874ee3
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue