Skip to content

Commit

Permalink
Foreign ID conflicts if ID is 0 for each item (#21271)
Browse files Browse the repository at this point in the history
The default is 0 if not defined, and that causes dupe index errors

Co-authored-by: 6543 <6543@obermui.de>
  • Loading branch information
techknowlogick and 6543 authored Oct 2, 2022
1 parent f82f1d0 commit 9e2f374
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions services/migrations/gitea_uploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ func (g *GiteaLocalUploader) CreateIssues(issues ...*base.Issue) error {
},
}

if is.ForeignReference.ForeignIndex == "0" {
is.ForeignReference.ForeignIndex = strconv.FormatInt(is.Index, 10)
}

if err := g.remapUser(issue, &is); err != nil {
return err
}
Expand Down

0 comments on commit 9e2f374

Please sign in to comment.