Skip to content

Commit

Permalink
Add missing migration script to register.go (apache#8178)
Browse files Browse the repository at this point in the history
* 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 <Josip.Stojak@infobip.com>
  • Loading branch information
sstojak1 and Josip Stojak authored Nov 8, 2024
1 parent 3a7acd6 commit 7d3a792
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
2 changes: 2 additions & 0 deletions backend/core/models/migrationscripts/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,5 +135,7 @@ func All() []plugin.MigrationScript {
new(addIsChildToCicdPipeline),
new(increaseCqIssueComponentLength),
new(addCqIssueImpacts),
new(changeIssueComponentType),
new(increaseCqProjectsIdLength),
}
}

0 comments on commit 7d3a792

Please sign in to comment.