diff --git a/dialect_mysql.go b/dialect_mysql.go index b9887a5c..573bfc0f 100644 --- a/dialect_mysql.go +++ b/dialect_mysql.go @@ -96,9 +96,9 @@ func (s *mysql) DataTypeOf(field *StructField) string { case reflect.Struct: if _, ok := dataValue.Interface().(time.Time); ok { if _, ok := field.TagSettings["NOT NULL"]; ok { - sqlType = "timestamp" + sqlType = fmt.Sprintf("timestamp(%d)", size) } else { - sqlType = "timestamp NULL" + sqlType = fmt.Sprintf("timestamp(%d) NULL", size) } } default: