Fix time for oracle

This commit is contained in:
Lunny Xiao 2021-08-14 00:03:08 +08:00
parent dbc2de380b
commit 66adc594d9
No known key found for this signature in database
GPG Key ID: C3B7C91B632F738A
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,10 @@ func FormatColumnTime(dialect Dialect, dbLocation *time.Location, col *schemas.C
} }
return t.Format(layout), nil return t.Format(layout), nil
case schemas.DateTime, schemas.TimeStamp: case schemas.DateTime, schemas.TimeStamp:
if dialect.URI().DBType == schemas.ORACLE {
return t, nil
}
var layout = "2006-01-02 15:04:05" var layout = "2006-01-02 15:04:05"
if col.Length > 0 { if col.Length > 0 {
layout += "." + strings.Repeat("0", col.Length) layout += "." + strings.Repeat("0", col.Length)