Merge f895ac4fc3422bb9f3b5dd2de3781c0f4ac86cfe into 89a726ce5da26da893dd3c2d8475e1d66677fd9c

This commit is contained in:
Masayuki 2018-02-09 15:01:47 +00:00 committed by GitHub
commit 8266c7abd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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: