From 66adc594d93714c686a379289c6e9dbda8006660 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 14 Aug 2021 00:03:08 +0800 Subject: [PATCH] Fix time for oracle --- dialects/time.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dialects/time.go b/dialects/time.go index f0bbb765..2c5e3da2 100644 --- a/dialects/time.go +++ b/dialects/time.go @@ -40,6 +40,10 @@ func FormatColumnTime(dialect Dialect, dbLocation *time.Location, col *schemas.C } return t.Format(layout), nil case schemas.DateTime, schemas.TimeStamp: + if dialect.URI().DBType == schemas.ORACLE { + return t, nil + } + var layout = "2006-01-02 15:04:05" if col.Length > 0 { layout += "." + strings.Repeat("0", col.Length)