Skip to content

Commit

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

Backport of #21271
  • Loading branch information
techknowlogick authored Oct 2, 2022
1 parent 0e677d7 commit cbebcc1
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 cbebcc1

Please sign in to comment.