From 300379e01605e2be08dd53ecea7ca7d347a21a1d Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Tue, 6 Oct 2015 22:56:28 +0800 Subject: [PATCH] bug fixed #297 --- VERSION | 2 +- session.go | 2 +- statement.go | 4 ++-- xorm.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 3341336d..23a53651 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -xorm v0.4.4.0924 +xorm v0.4.4.1006 diff --git a/session.go b/session.go index 419a5876..5f391bdc 100644 --- a/session.go +++ b/session.go @@ -3565,7 +3565,7 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6 colNames, args = buildUpdates(session.Engine, table, bean, false, false, false, false, session.Statement.allUseBool, session.Statement.useAllCols, session.Statement.mustColumnMap, session.Statement.nullableMap, - session.Statement.columnMap, true) + session.Statement.columnMap, true, session.Statement.unscoped) } else { colNames, args, err = genCols(table, session, bean, true, true) if err != nil { diff --git a/statement.go b/statement.go index 6064c542..df6d9104 100644 --- a/statement.go +++ b/statement.go @@ -182,7 +182,7 @@ func buildUpdates(engine *Engine, table *core.Table, bean interface{}, includeVersion bool, includeUpdated bool, includeNil bool, includeAutoIncr bool, allUseBool bool, useAllCols bool, mustColumnMap map[string]bool, nullableMap map[string]bool, - columnMap map[string]bool, update bool) ([]string, []interface{}) { + columnMap map[string]bool, update, unscoped bool) ([]string, []interface{}) { colNames := make([]string, 0) var args = make([]interface{}, 0) @@ -199,7 +199,7 @@ func buildUpdates(engine *Engine, table *core.Table, bean interface{}, if !includeAutoIncr && col.IsAutoIncrement { continue } - if col.IsDeleted { + if col.IsDeleted && !unscoped { continue } if use, ok := columnMap[col.Name]; ok && !use { diff --git a/xorm.go b/xorm.go index 791c1cbd..3ea2feb2 100644 --- a/xorm.go +++ b/xorm.go @@ -17,7 +17,7 @@ import ( ) const ( - Version string = "0.4.4.0824" + Version string = "0.4.4.1006" ) func regDrvsNDialects() bool {