From 9e2f37404c2145c70ec7896eae7705029617eefd Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Sun, 2 Oct 2022 17:43:16 -0400 Subject: [PATCH] Foreign ID conflicts if ID is 0 for each item (#21271) The default is 0 if not defined, and that causes dupe index errors Co-authored-by: 6543 <6543@obermui.de> --- services/migrations/gitea_uploader.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go index 5bf77e6332146..83388391da26f 100644 --- a/services/migrations/gitea_uploader.go +++ b/services/migrations/gitea_uploader.go @@ -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 }