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

klesh 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 7d3a79202 Add missing migration script to register.go (#8178)
7d3a79202 is described below

commit 7d3a792029cc9386627d5e01aa1de5339cde9019
Author: sstojak1 <[email protected]>
AuthorDate: Fri Nov 8 08:13:01 2024 +0100

    Add missing migration script to register.go (#8178)
    
    * bug: add missing migration script to register.go
    
    * bug: add missing migration script to register.go - 
increaseProjectKeyLength
    
    * bug: rename script column name
    
    * increasing id instead of project_key
    
    ---------
    
    Co-authored-by: Josip Stojak <[email protected]>
---
 .../20240813_change_issue_component_type.go                |  2 +-
 ...ength.go => 20240813_increase_cq_projects_id_length.go} | 14 +++++++-------
 backend/core/models/migrationscripts/register.go           |  2 ++
 3 files changed, 10 insertions(+), 8 deletions(-)

diff --git 
a/backend/core/models/migrationscripts/20240813_change_issue_component_type.go 
b/backend/core/models/migrationscripts/20240813_change_issue_component_type.go
index 8f7a2f2fe..9b3316b43 100644
--- 
a/backend/core/models/migrationscripts/20240813_change_issue_component_type.go
+++ 
b/backend/core/models/migrationscripts/20240813_change_issue_component_type.go
@@ -28,7 +28,7 @@ var _ plugin.MigrationScript = 
(*changeIssueComponentType)(nil)
 type changeIssueComponentType struct{}
 
 func (script *changeIssueComponentType) Up(basicRes context.BasicRes) 
errors.Error {
-       return basicRes.GetDal().ModifyColumnType("issues", "components", 
"text")
+       return basicRes.GetDal().ModifyColumnType("issues", "component", "text")
 }
 
 func (*changeIssueComponentType) Version() uint64 {
diff --git 
a/backend/core/models/migrationscripts/20240813_increase_project_key_length.go 
b/backend/core/models/migrationscripts/20240813_increase_cq_projects_id_length.go
similarity index 69%
rename from 
backend/core/models/migrationscripts/20240813_increase_project_key_length.go
rename to 
backend/core/models/migrationscripts/20240813_increase_cq_projects_id_length.go
index 609b3d736..86db2d758 100644
--- 
a/backend/core/models/migrationscripts/20240813_increase_project_key_length.go
+++ 
b/backend/core/models/migrationscripts/20240813_increase_cq_projects_id_length.go
@@ -23,18 +23,18 @@ import (
        "github.com/apache/incubator-devlake/core/plugin"
 )
 
-var _ plugin.MigrationScript = (*increaseProjectKeyLength)(nil)
+var _ plugin.MigrationScript = (*increaseCqProjectsIdLength)(nil)
 
-type increaseProjectKeyLength struct{}
+type increaseCqProjectsIdLength struct{}
 
-func (script *increaseProjectKeyLength) Up(basicRes context.BasicRes) 
errors.Error {
-       return basicRes.GetDal().ModifyColumnType("cq_projects", "project_key", 
"varchar(500)")
+func (script *increaseCqProjectsIdLength) Up(basicRes context.BasicRes) 
errors.Error {
+       return basicRes.GetDal().ModifyColumnType("cq_projects", "id", 
"varchar(500)")
 }
 
-func (*increaseProjectKeyLength) Version() uint64 {
+func (*increaseCqProjectsIdLength) Version() uint64 {
        return 20240813160242
 }
 
-func (*increaseProjectKeyLength) Name() string {
-       return "increase cq_projects.project_key length to 500"
+func (*increaseCqProjectsIdLength) Name() string {
+       return "increase cq_projects.id length to 500"
 }
diff --git a/backend/core/models/migrationscripts/register.go 
b/backend/core/models/migrationscripts/register.go
index abdcde958..036dbf130 100644
--- a/backend/core/models/migrationscripts/register.go
+++ b/backend/core/models/migrationscripts/register.go
@@ -135,5 +135,7 @@ func All() []plugin.MigrationScript {
                new(addIsChildToCicdPipeline),
                new(increaseCqIssueComponentLength),
                new(addCqIssueImpacts),
+               new(changeIssueComponentType),
+               new(increaseCqProjectsIdLength),
        }
 }

Reply via email to