diff --git a/VERSION b/VERSION index eefd2a22..22d10ea8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -xorm v0.6.0.0923 \ No newline at end of file +xorm v0.6.0.0927 \ No newline at end of file diff --git a/helpers.go b/helpers.go index 9a461c0e..e82a85f4 100644 --- a/helpers.go +++ b/helpers.go @@ -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) args = append(args, val) diff --git a/xorm.go b/xorm.go index 07405e2d..048d5b4f 100644 --- a/xorm.go +++ b/xorm.go @@ -17,7 +17,7 @@ import ( const ( // Version show the xorm's version - Version string = "0.6.0.0923" + Version string = "0.6.0.0927" ) func regDrvsNDialects() bool {