Browse Source

Fix bug of migraition v111 (#12738)

for-closed-social
Lunny Xiao 4 years ago
committed by GitHub
parent
commit
e8958bfc38
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      models/migrations/v111.go

+ 3
- 3
models/migrations/v111.go View File

@ -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 {

Loading…
Cancel
Save