Browse Source

fix updated update on public key (#2514)

* fix updated update on public key

* update vendor.json

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>

* fix root path

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Lunny Xiao 2 years ago
parent
commit
0f9e20b3d7
2 changed files with 16 additions and 14 deletions
  1. 13 11
      vendor/github.com/go-xorm/xorm/session_update.go
  2. 3 3
      vendor/vendor.json

+ 13 - 11
vendor/github.com/go-xorm/xorm/session_update.go

@@ -202,17 +202,19 @@ func (session *Session) Update(bean interface{}, condiBean ...interface{}) (int6
202 202
 	table := session.statement.RefTable
203 203
 
204 204
 	if session.statement.UseAutoTime && table != nil && table.Updated != "" {
205
-		colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?")
206
-		col := table.UpdatedColumn()
207
-		val, t := session.engine.NowTime2(col.SQLType.Name)
208
-		args = append(args, val)
209
-
210
-		var colName = col.Name
211
-		if isStruct {
212
-			session.afterClosures = append(session.afterClosures, func(bean interface{}) {
213
-				col := table.GetColumn(colName)
214
-				setColumnTime(bean, col, t)
215
-			})
205
+		if _, ok := session.statement.columnMap[strings.ToLower(table.Updated)]; !ok {
206
+			colNames = append(colNames, session.engine.Quote(table.Updated)+" = ?")
207
+			col := table.UpdatedColumn()
208
+			val, t := session.engine.NowTime2(col.SQLType.Name)
209
+			args = append(args, val)
210
+
211
+			var colName = col.Name
212
+			if isStruct {
213
+				session.afterClosures = append(session.afterClosures, func(bean interface{}) {
214
+					col := table.GetColumn(colName)
215
+					setColumnTime(bean, col, t)
216
+				})
217
+			}
216 218
 		}
217 219
 	}
218 220
 

+ 3 - 3
vendor/vendor.json

@@ -468,10 +468,10 @@
468 468
 			"revisionTime": "2016-08-11T02:11:45Z"
469 469
 		},
470 470
 		{
471
-			"checksumSHA1": "SoZDnkd5NdwE0g4MY1nTAl8ZtPo=",
471
+			"checksumSHA1": "lAzHeuH461JyawhsGLi27JpWsgs=",
472 472
 			"path": "github.com/go-xorm/xorm",
473
-			"revision": "c29485f954ed6495861c0098f9a1642a467299c8",
474
-			"revisionTime": "2017-09-10T12:58:18Z"
473
+			"revision": "3101e3bc440f16f151687d97bce94da063c486f5",
474
+			"revisionTime": "2017-09-15T01:51:15Z"
475 475
 		},
476 476
 		{
477 477
 			"checksumSHA1": "1ft/4j5MFa7C9dPI9whL03HSUzk=",