aboutsummaryrefslogtreecommitdiffstats
path: root/models/issue.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-02-18 08:42:13 +0800
committerGitHub <noreply@github.com>2020-02-17 19:42:13 -0500
commitce0413ff8894660f0a5f0a87cbadb6baacb80e4a (patch)
tree6608e4b26f200eba0dc4f6ca3489e791ff9baccd /models/issue.go
parente76a64dda173db84e34eefc6baaa2981fe4a6801 (diff)
downloadgitea-ce0413ff8894660f0a5f0a87cbadb6baacb80e4a.tar.gz
gitea-ce0413ff8894660f0a5f0a87cbadb6baacb80e4a.zip
Fix migration information update bug when linked github account (#10310)
* Fix bug on upgrade migrated reactions * Fix migration information update bug when linked github account Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'models/issue.go')
-rw-r--r--models/issue.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/models/issue.go b/models/issue.go
index 4c33767d2a..afd110e06d 100644
--- a/models/issue.go
+++ b/models/issue.go
@@ -1873,9 +1873,8 @@ func UpdateIssuesMigrationsByType(gitServiceType structs.GitServiceType, origina
// UpdateReactionsMigrationsByType updates all migrated repositories' reactions from gitServiceType to replace originalAuthorID to posterID
func UpdateReactionsMigrationsByType(gitServiceType structs.GitServiceType, originalAuthorID string, userID int64) error {
_, err := x.Table("reaction").
- Join("INNER", "issue", "issue.id = reaction.issue_id").
- Where("issue.repo_id IN (SELECT id FROM repository WHERE original_service_type = ?)", gitServiceType).
- And("reaction.original_author_id = ?", originalAuthorID).
+ Where("original_author_id = ?", originalAuthorID).
+ And(migratedIssueCond(gitServiceType)).
Update(map[string]interface{}{
"user_id": userID,
"original_author": "",