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

abeizn pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


The following commit(s) were added to refs/heads/main by this push:
     new 54ecaadfc fix: fix the migration script of _tool_github_runs (#5255)
54ecaadfc is described below

commit 54ecaadfc00bbd6fc75b5783176f7333234919e3
Author: Liang Zhang <[email protected]>
AuthorDate: Mon May 22 19:42:32 2023 +0800

    fix: fix the migration script of _tool_github_runs (#5255)
---
 .../models/migrationscripts/20230518_fix_run_name_to_text.go  | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git 
a/backend/plugins/github/models/migrationscripts/20230518_fix_run_name_to_text.go
 
b/backend/plugins/github/models/migrationscripts/20230518_fix_run_name_to_text.go
index 88c7f40de..c1eaee16e 100644
--- 
a/backend/plugins/github/models/migrationscripts/20230518_fix_run_name_to_text.go
+++ 
b/backend/plugins/github/models/migrationscripts/20230518_fix_run_name_to_text.go
@@ -28,14 +28,14 @@ type fixRunNameToText struct{}
 type githubRun20230518_old struct {
        ConnectionId uint64 `gorm:"primaryKey"`
        RepoId       int    `gorm:"primaryKey"`
-
-       Name string `gorm:"type:varchar(255)"`
+       ID           int    `gorm:"primaryKey;autoIncrement:false"`
+       Name         string `gorm:"type:varchar(255)"`
 }
 type githubRun20230518 struct {
        ConnectionId uint64 `gorm:"primaryKey"`
        RepoId       int    `gorm:"primaryKey"`
-
-       Name string `gorm:"type:text"`
+       ID           int    `gorm:"primaryKey;autoIncrement:false"`
+       Name         string `gorm:"type:text"`
 }
 
 func (*fixRunNameToText) Up(baseRes context.BasicRes) errors.Error {
@@ -48,6 +48,7 @@ func (*fixRunNameToText) Up(baseRes context.BasicRes) 
errors.Error {
                        return &githubRun20230518{
                                ConnectionId: src.ConnectionId,
                                RepoId:       src.RepoId,
+                               ID:           src.ID,
                                Name:         src.Name,
                        }, nil
                },
@@ -61,7 +62,7 @@ func (*fixRunNameToText) Up(baseRes context.BasicRes) 
errors.Error {
 }
 
 func (*fixRunNameToText) Version() uint64 {
-       return 20230518000001
+       return 20230518000002
 }
 
 func (*fixRunNameToText) Name() string {

Reply via email to