diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2020-09-06 18:34:51 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-06 11:34:51 +0100 |
commit | e8958bfc38e82148f4c8cecb98f5faed4fd84420 (patch) | |
tree | 38598de55492ba3b9ab9c1f45c64bb63a313dc24 /models/migrations/v111.go | |
parent | 0cc4aadf58d5c1668af9042d41d9f855ae3d1366 (diff) | |
download | gitea-e8958bfc38e82148f4c8cecb98f5faed4fd84420.tar.gz gitea-e8958bfc38e82148f4c8cecb98f5faed4fd84420.zip |
Fix bug of migraition v111 (#12738)
Diffstat (limited to 'models/migrations/v111.go')
-rw-r--r-- | models/migrations/v111.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/migrations/v111.go b/models/migrations/v111.go index 12eb2d2444..93831de94a 100644 --- a/models/migrations/v111.go +++ b/models/migrations/v111.go @@ -380,10 +380,10 @@ func addBranchProtectionCanPushAndEnableWhitelist(x *xorm.Engine) error { } totalPages := totalIssues / pageSize - // Find latest review of each user in each pull request, and set official field if appropriate - reviews := []*Review{} - var executeBody = func(page, pageSize int64) error { + // Find latest review of each user in each pull request, and set official field if appropriate + reviews := []*Review{} + if err := x.SQL("SELECT * FROM review WHERE id IN (SELECT max(id) as id FROM review WHERE issue_id > ? AND issue_id <= ? AND type in (?, ?) GROUP BY issue_id, reviewer_id)", page*pageSize, (page+1)*pageSize, ReviewTypeApprove, ReviewTypeReject). Find(&reviews); err != nil { |