diff options
author | singuliere <35190819+singuliere@users.noreply.github.com> | 2022-03-06 20:00:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 20:00:41 +0100 |
commit | cc643284de106a609b4ac03ed2a7f615ab6d312a (patch) | |
tree | 8fa1a70d658a6185d4e7cdcef80000cc47e81e74 /services/migrations/onedev.go | |
parent | b24e8d38af21fc1857b6aa66351627e3b1761608 (diff) | |
download | gitea-cc643284de106a609b4ac03ed2a7f615ab6d312a.tar.gz gitea-cc643284de106a609b4ac03ed2a7f615ab6d312a.zip |
Add Index to comment for migrations and mirroring (#18806)
Comments have an id (see Gitea[0], GitLab[1], GitHub[2], etc.), and the
comment migration format must represent it during migrations so that
it can be used during mirroring or incremental migrations.
[0] https://try.gitea.io/api/swagger#/issue/issueGetComment
[1] https://docs.gitlab.com/ee/api/discussions.html#get-single-issue-discussion-item
[2] https://docs.github.com/en/rest/reference/issues#get-an-issue-comment
Signed-off-by: Loïc Dachary <loic@dachary.org>
Co-authored-by: Loïc Dachary <loic@dachary.org>
Diffstat (limited to 'services/migrations/onedev.go')
-rw-r--r-- | services/migrations/onedev.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/services/migrations/onedev.go b/services/migrations/onedev.go index c8253e8947..d27cbbed4f 100644 --- a/services/migrations/onedev.go +++ b/services/migrations/onedev.go @@ -379,6 +379,7 @@ func (d *OneDevDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Com } rawComments := make([]struct { + ID int64 `json:"id"` Date time.Time `json:"date"` UserID int64 `json:"userId"` Content string `json:"content"` @@ -429,6 +430,7 @@ func (d *OneDevDownloader) GetComments(opts base.GetCommentOptions) ([]*base.Com poster := d.tryGetUser(comment.UserID) comments = append(comments, &base.Comment{ IssueIndex: context.LocalID(), + Index: comment.ID, PosterID: poster.ID, PosterName: poster.Name, PosterEmail: poster.Email, |