diff options
author | zeripath <art27@cantab.net> | 2021-03-23 23:10:19 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 23:10:19 +0000 |
commit | 750ac52db2a48fb7be4a508feb527a1ffac952c6 (patch) | |
tree | ae9fd608b54108ac220175f305ad2fa032c3f6d5 /models/repo_transfer.go | |
parent | f4e677edb1f236cd802f5dd2f0759252c9235bd6 (diff) | |
download | gitea-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/repo_transfer.go')
-rw-r--r-- | models/repo_transfer.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/models/repo_transfer.go b/models/repo_transfer.go index 60f3d15734..c5d1a3a3c2 100644 --- a/models/repo_transfer.go +++ b/models/repo_transfer.go @@ -333,7 +333,7 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err e INNER JOIN label ON il_too_too.label_id = label.id INNER JOIN issue on issue.id = il_too_too.issue_id WHERE - issue.repo_id = ? AND (issue.repo_id != label.repo_id OR (label.repo_id = 0 AND label.org_id != ?)) + issue.repo_id = ? AND ((label.org_id = 0 AND issue.repo_id != label.repo_id) OR (label.repo_id = 0 AND label.org_id != ?)) ) AS il_too )`, repo.ID, newOwner.ID); err != nil { return fmt.Errorf("Unable to remove old org labels: %v", err) } @@ -343,9 +343,9 @@ func TransferOwnership(doer *User, newOwnerName string, repo *Repository) (err e SELECT com.id FROM comment AS com INNER JOIN label ON com.label_id = label.id - INNER JOIN issue on issue.id = com.issue_id + INNER JOIN issue ON issue.id = com.issue_id WHERE - com.type = ? AND issue.repo_id = ? AND (issue.repo_id != label.repo_id OR (label.repo_id = 0 AND label.org_id != ?)) + com.type = ? AND issue.repo_id = ? AND ((label.org_id = 0 AND issue.repo_id != label.repo_id) OR (label.repo_id = 0 AND label.org_id != ?)) ) AS il_too)`, CommentTypeLabel, repo.ID, newOwner.ID); err != nil { return fmt.Errorf("Unable to remove old org label comments: %v", err) } |