aboutsummaryrefslogtreecommitdiffstats
path: root/services/migrations
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2022-10-02 17:43:16 -0400
committerGitHub <noreply@github.com>2022-10-02 17:43:16 -0400
commit9e2f37404c2145c70ec7896eae7705029617eefd (patch)
tree14b7be7b32ba0ccefd82779fdcafdb10600f56e8 /services/migrations
parentf82f1d05b11eb63d4d03cc5ff6cbcb82d75eba8f (diff)
downloadgitea-9e2f37404c2145c70ec7896eae7705029617eefd.tar.gz
gitea-9e2f37404c2145c70ec7896eae7705029617eefd.zip
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>
Diffstat (limited to 'services/migrations')
-rw-r--r--services/migrations/gitea_uploader.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/migrations/gitea_uploader.go b/services/migrations/gitea_uploader.go
index 5bf77e6332..83388391da 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
}