This commit is contained in:
Lunny Xiao 2016-09-27 11:17:35 +08:00
parent 845e343cad
commit e2e54d57c9
3 changed files with 4 additions and 3 deletions

View File

@ -1 +1 @@
xorm v0.6.0.0923 xorm v0.6.0.0927

View File

@ -550,7 +550,8 @@ func genCols(table *core.Table, session *Session, bean interface{}, useCol bool,
} }
} }
if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime { if (col.IsCreated || col.IsUpdated) && session.Statement.UseAutoTime && !isZero(fieldValue.Interface()) {
// if time is non-empty, then set to auto time
val, t := session.Engine.NowTime2(col.SQLType.Name) val, t := session.Engine.NowTime2(col.SQLType.Name)
args = append(args, val) args = append(args, val)

View File

@ -17,7 +17,7 @@ import (
const ( const (
// Version show the xorm's version // Version show the xorm's version
Version string = "0.6.0.0923" Version string = "0.6.0.0927"
) )
func regDrvsNDialects() bool { func regDrvsNDialects() bool {