This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch release-v1.0-auto-cherry-pick-7645
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 4b175bc76acef3d4a35b7c94c73a3e4a4d341093
Author: abeizn <[email protected]>
AuthorDate: Fri Jun 21 10:37:30 2024 +0800

    fix: pr reviewers and assignees script version error (#7645)
    
    * fix: pr reviewers and assignees script version error
    
    * fix: adapt pg test
---
 .../20240531_add_pr_assignees_and_reviewers.go             |  2 +-
 .../20240607_modify_pr_assignees_and_reviewers_id.go       | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git 
a/backend/core/models/migrationscripts/20240531_add_pr_assignees_and_reviewers.go
 
b/backend/core/models/migrationscripts/20240531_add_pr_assignees_and_reviewers.go
index fa852c960..d7cbd9f9f 100644
--- 
a/backend/core/models/migrationscripts/20240531_add_pr_assignees_and_reviewers.go
+++ 
b/backend/core/models/migrationscripts/20240531_add_pr_assignees_and_reviewers.go
@@ -35,7 +35,7 @@ func (u *addPrAssigneeAndReviewer) Up(basicRes 
context.BasicRes) errors.Error {
 }
 
 func (*addPrAssigneeAndReviewer) Version() uint64 {
-       return 20250531000041
+       return 20240531000041
 }
 
 func (*addPrAssigneeAndReviewer) Name() string {
diff --git 
a/backend/core/models/migrationscripts/20240607_modify_pr_assignees_and_reviewers_id.go
 
b/backend/core/models/migrationscripts/20240607_modify_pr_assignees_and_reviewers_id.go
index adfe318ed..3d144d3b4 100644
--- 
a/backend/core/models/migrationscripts/20240607_modify_pr_assignees_and_reviewers_id.go
+++ 
b/backend/core/models/migrationscripts/20240607_modify_pr_assignees_and_reviewers_id.go
@@ -28,7 +28,17 @@ type modifyPrAssigneeAndReviewerId struct{}
 
 func (u *modifyPrAssigneeAndReviewerId) Up(basicRes context.BasicRes) 
errors.Error {
        db := basicRes.GetDal()
-       err := db.DropTables(&archived.PullRequestAssignee{}, 
&archived.PullRequestReviewer{})
+       err := db.Exec(`delete from _devlake_migration_history
+                       where script_version='20250531000041' and 
script_name='add pull_request_reviewers and pull_request_assignees tables'`)
+       if err != nil {
+               return err
+       }
+       err = db.Exec(`delete from _devlake_migration_history
+                               where script_version='20250607000041' and 
script_name='modify pull_request_reviewers and pull_request_assignees id 
columns'`)
+       if err != nil {
+               return err
+       }
+       err = db.DropTables(&archived.PullRequestAssignee{}, 
&archived.PullRequestReviewer{})
        if err != nil {
                return err
        }
@@ -40,7 +50,7 @@ func (u *modifyPrAssigneeAndReviewerId) Up(basicRes 
context.BasicRes) errors.Err
 }
 
 func (*modifyPrAssigneeAndReviewerId) Version() uint64 {
-       return 20250607000041
+       return 20240607000041
 }
 
 func (*modifyPrAssigneeAndReviewerId) Name() string {

Reply via email to