mirror of https://github.com/go-gorm/gorm.git
corresponds timestamp precision for mysql
This commit is contained in:
parent
89a726ce5d
commit
ae696d051f
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue