From a06ca0d4d6ba8101476ec63e0833c867fe01249b Mon Sep 17 00:00:00 2001 From: Gerhard Gruber Date: Tue, 23 Nov 2021 14:36:56 +0100 Subject: [PATCH] order by for update not supported --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 92e7643f..42e78723 100644 --- a/main.go +++ b/main.go @@ -419,7 +419,7 @@ func (s *DB) UpdateColumn(attrs ...interface{}) *DB { // UpdateColumns update attributes without callbacks, refer: https://jinzhu.github.io/gorm/crud.html#update func (s *DB) UpdateColumns(values interface{}) *DB { - return s.NewScope(s.Value). + return s.Order(nil, true).NewScope(s.Value). Set("gorm:update_column", true). Set("gorm:save_associations", false). InstanceSet("gorm:update_interface", values).