From e3b6f79b4337b7e29a4f9c3814fc9371ad75b468 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sat, 12 Jun 2021 15:04:06 +0800 Subject: [PATCH] Fix test --- session_insert.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/session_insert.go b/session_insert.go index f4b5b818..bcd52941 100644 --- a/session_insert.go +++ b/session_insert.go @@ -500,7 +500,11 @@ func (session *Session) genInsertColumns(bean interface{}) ([]string, []interfac if col.IsDeleted { colNames = append(colNames, col.Name) if !col.Nullable { - args = append(args, time.Time{}) + if col.SQLType.IsNumeric() { + args = append(args, 0) + } else { + args = append(args, time.Time{}) + } } else { args = append(args, nil) }