Skip to content

Commit dfb3e50

Browse files
authored
Fix the v176 migration (#15110)
There is a serious issue with the v176 migration where there is a mistaken missing label_id selection. *introduced by #14912* Signed-off-by: Andrew Thornton <art27@cantab.net>
1 parent 5f038cd commit dfb3e50

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

models/consistency.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ func FixIssueLabelWithOutsideLabels() (int64, error) {
380380
SELECT il_too.id FROM (
381381
SELECT il_too_too.id
382382
FROM issue_label AS il_too_too
383-
INNER JOIN label ON il_too_too.id = label.id
383+
INNER JOIN label ON il_too_too.label_id = label.id
384384
INNER JOIN issue on issue.id = il_too_too.issue_id
385385
INNER JOIN repository on repository.id = issue.repo_id
386386
WHERE

models/migrations/v176.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func removeInvalidLabels(x *xorm.Engine) error {
4848
SELECT il_too.id FROM (
4949
SELECT il_too_too.id
5050
FROM issue_label AS il_too_too
51-
INNER JOIN label ON il_too_too.id = label.id
51+
INNER JOIN label ON il_too_too.label_id = label.id
5252
INNER JOIN issue on issue.id = il_too_too.issue_id
5353
INNER JOIN repository on repository.id = issue.repo_id
5454
WHERE

models/repo_transfer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err e
330330
SELECT il_too.id FROM (
331331
SELECT il_too_too.id
332332
FROM issue_label AS il_too_too
333-
INNER JOIN label ON il_too_too.id = label.id
333+
INNER JOIN label ON il_too_too.label_id = label.id
334334
INNER JOIN issue on issue.id = il_too_too.issue_id
335335
WHERE
336336
issue.repo_id = ? AND (issue.repo_id != label.repo_id OR (label.repo_id = 0 AND label.org_id != ?))

0 commit comments

Comments
 (0)