This commit is contained in:
Lunny Xiao 2021-06-12 15:04:06 +08:00
parent 761926fd8b
commit e3b6f79b43
1 changed files with 5 additions and 1 deletions

View File

@ -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)
}