From 557b874ee3c9a6df9ffc5cd4a4bf2d89d3e788d5 Mon Sep 17 00:00:00 2001 From: Jinzhu Date: Wed, 25 Nov 2020 14:55:53 +0800 Subject: [PATCH] Fix check field's precision --- migrator/migrator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrator/migrator.go b/migrator/migrator.go index 5de820a8..084d430f 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(fullDataType, fmt.Sprint(field.Precision)) { + if strings.Contains(m.DataTypeOf(field), fmt.Sprint(field.Precision)) { alterColumn = true } }