@@ -155,7 +155,7 @@ func (s *Services) migrateIssues(c echo.Context) error {
155155 }
156156
157157 idsMap := make (map [uuid.UUID ]uuid.UUID )
158- idsCommentMap := make (map [string ] string )
158+ idsCommentMap := make (map [uuid. UUID ]uuid. UUID )
159159 linkedIds := make (map [string ]struct {})
160160 var srcIssueUUId uuid.UUID
161161 var familyIds , newFamilyIds []string
@@ -213,7 +213,7 @@ func (s *Services) migrateIssues(c echo.Context) error {
213213 return EError (c , err )
214214 }
215215 for _ , comment := range comments {
216- idsCommentMap [comment .Id ] = dao .GenID ()
216+ idsCommentMap [comment .Id ] = dao .GenUUID ()
217217 }
218218
219219 if createEntities {
@@ -599,7 +599,7 @@ func (s *Services) migrateIssuesByLabel(c echo.Context) error {
599599 }
600600
601601 idsMap := make (map [uuid.UUID ]uuid.UUID )
602- idsCommentMap := make (map [string ] string )
602+ idsCommentMap := make (map [uuid. UUID ]uuid. UUID )
603603 linkedIds := make (map [string ]struct {})
604604
605605 var targetIds , newTargetIds []string
@@ -656,7 +656,7 @@ func (s *Services) migrateIssuesByLabel(c echo.Context) error {
656656 return EError (c , err )
657657 }
658658 for _ , comment := range comments {
659- idsCommentMap [comment .Id ] = dao .GenID ()
659+ idsCommentMap [comment .Id ] = dao .GenUUID ()
660660 }
661661
662662 if createEntities {
@@ -1253,7 +1253,7 @@ func migrateIssueMove(issue IssueCheckResult, user dao.User, tx *gorm.DB, idsMap
12531253 return nil
12541254}
12551255
1256- func migrateIssueCopy (issue IssueCheckResult , user dao.User , tx * gorm.DB , idsMap map [uuid.UUID ]uuid.UUID , idsCommentMap map [string ] string , single bool ) error {
1256+ func migrateIssueCopy (issue IssueCheckResult , user dao.User , tx * gorm.DB , idsMap map [uuid.UUID ]uuid.UUID , idsCommentMap map [uuid. UUID ]uuid. UUID , single bool ) error {
12571257 srcIssue := issue .SrcIssue
12581258
12591259 if issue .Migrate {
@@ -1383,7 +1383,7 @@ func migrateIssueCopy(issue IssueCheckResult, user dao.User, tx *gorm.DB, idsMap
13831383 // Comments, reactions
13841384 {
13851385 var comments []dao.IssueComment
1386- var commentIds []string
1386+ var commentIds []uuid. UUID
13871387
13881388 if err := tx .Where ("issue_id = ?" , srcIssue .ID ).Find (& comments ).Error ; err != nil {
13891389 return err
@@ -1394,9 +1394,9 @@ func migrateIssueCopy(issue IssueCheckResult, user dao.User, tx *gorm.DB, idsMap
13941394 comments [i ].Id = idsCommentMap [comments [i ].Id ]
13951395 comments [i ].IssueId = targetIssue .ID .String ()
13961396 comments [i ].ProjectId = issue .TargetProject .ID
1397- if comments [i ].ReplyToCommentId != nil {
1398- replyId := idsCommentMap [* comments [i ].ReplyToCommentId ]
1399- comments [i ].ReplyToCommentId = & replyId
1397+ if comments [i ].ReplyToCommentId . Valid {
1398+ replyId := idsCommentMap [comments [i ].ReplyToCommentId . UUID ]
1399+ comments [i ].ReplyToCommentId = uuid. NullUUID { UUID : replyId , Valid : true }
14001400 }
14011401 }
14021402
0 commit comments