Fix bug of migraition v111 (#12738)

tokarchuk/v1.17
Lunny Xiao 4 years ago committed by GitHub
parent 0cc4aadf58
commit e8958bfc38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      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 {

Loading…
Cancel
Save