mirror of
https://github.com/go-gitea/gitea
synced 2025-07-12 13:37:20 +00:00
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>
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user