summaryrefslogtreecommitdiffstats
path: root/models/migrations/v176.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2021-03-23 23:10:19 +0000
committerGitHub <noreply@github.com>2021-03-23 23:10:19 +0000
commit750ac52db2a48fb7be4a508feb527a1ffac952c6 (patch)
treeae9fd608b54108ac220175f305ad2fa032c3f6d5 /models/migrations/v176.go
parentf4e677edb1f236cd802f5dd2f0759252c9235bd6 (diff)
downloadgitea-750ac52db2a48fb7be4a508feb527a1ffac952c6.tar.gz
gitea-750ac52db2a48fb7be4a508feb527a1ffac952c6.zip
Fix Migration 176 yet again (#15131)
* Fix Migration 176 yet again Whilst creating a test for v176 in the migrations_test PR it has become clear that this was still wrong. This is now fixed. Genuinely. Signed-off-by: Andrew Thornton <art27@cantab.net> * and fix repo transfer Signed-off-by: Andrew Thornton <art27@cantab.net>
Diffstat (limited to 'models/migrations/v176.go')
-rw-r--r--models/migrations/v176.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/models/migrations/v176.go b/models/migrations/v176.go
index 0365ae5673..cec23e08f4 100644
--- a/models/migrations/v176.go
+++ b/models/migrations/v176.go
@@ -52,7 +52,7 @@ func removeInvalidLabels(x *xorm.Engine) error {
INNER JOIN issue on issue.id = il_too_too.issue_id
INNER JOIN repository on repository.id = issue.repo_id
WHERE
- issue.repo_id != label.repo_id OR (label.repo_id = 0 AND label.org_id != repository.owner_id)
+ (label.org_id = 0 AND issue.repo_id != label.repo_id) OR (label.repo_id = 0 AND label.org_id != repository.owner_id)
) AS il_too )`); err != nil {
return err
}
@@ -65,7 +65,7 @@ func removeInvalidLabels(x *xorm.Engine) error {
INNER JOIN issue on issue.id = com.issue_id
INNER JOIN repository on repository.id = issue.repo_id
WHERE
- com.type = ? AND (issue.repo_id != label.repo_id OR (label.repo_id = 0 AND label.org_id != repository.owner_id))
+ com.type = ? AND ((label.org_id = 0 AND issue.repo_id != label.repo_id) OR (label.repo_id = 0 AND label.org_id != repository.owner_id))
) AS il_too)`, 7); err != nil {
return err
}