You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by gi...@apache.org on 2024/06/21 02:37:49 UTC

(incubator-devlake) branch release-v1.0-auto-cherry-pick-7645 created (now 4b175bc76)

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

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


      at 4b175bc76 fix: pr reviewers and assignees script version error (#7645)

This branch includes the following new commits:

     new 4b175bc76 fix: pr reviewers and assignees script version error (#7645)

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-devlake) 01/01: fix: pr reviewers and assignees script version error (#7645)

Posted by gi...@apache.org.
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 <zi...@merico.dev>
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 {