1. suport date time '2070-03-30 00:00:00',timestamp can't support large date time.

This commit is contained in:
lotus 2018-03-30 14:01:28 +08:00
parent 52c5c8127c
commit 8d029a9db3

View File

@ -101,9 +101,9 @@ func (s *mysql) DataTypeOf(field *StructField) string {
}
if _, ok := field.TagSettings["NOT NULL"]; ok {
sqlType = fmt.Sprintf("timestamp%v", precision)
sqlType = fmt.Sprintf("DATETIME%v", precision)
} else {
sqlType = fmt.Sprintf("timestamp%v NULL", precision)
sqlType = fmt.Sprintf("DATETIME%v NULL", precision)
}
}
default: