Skip to content

Commit 8749a36

Browse files
fix(jenkins): expand primary_view column to text
1 parent c1b617f commit 8749a36

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

backend/plugins/jenkins/models/job.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type JenkinsJob struct {
3535
Base string `gorm:"type:varchar(255)" mapstructure:"base,omitempty" json:"base"`
3636
Url string `mapstructure:"url,omitempty" json:"url"`
3737
Description string `mapstructure:"description,omitempty" json:"description"`
38-
PrimaryView string `gorm:"type:varchar(255)" mapstructure:"primaryView,omitempty" json:"primaryView"`
38+
PrimaryView string `gorm:"type:text" mapstructure:"primaryView,omitempty" json:"primaryView"`
3939
}
4040

4141
func (JenkinsJob) TableName() string {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package migrationscripts
2+
3+
import (
4+
"github.com/apache/incubator-devlake/core/context"
5+
"github.com/apache/incubator-devlake/core/errors"
6+
"github.com/apache/incubator-devlake/helpers/migrationhelper"
7+
)
8+
9+
type expandPrimaryView struct{}
10+
11+
type JenkinsJob20260602 struct {
12+
PrimaryView string `gorm:"type:text"`
13+
}
14+
15+
func (JenkinsJob20260602) TableName() string {
16+
return "_tool_jenkins_jobs"
17+
}
18+
19+
func (u *expandPrimaryView) Up(baseRes context.BasicRes) errors.Error {
20+
return migrationhelper.AutoMigrateTables(baseRes, &JenkinsJob20260602{})
21+
}
22+
23+
func (*expandPrimaryView) Version() uint64 {
24+
return 20260602000000
25+
}
26+
27+
func (*expandPrimaryView) Name() string {
28+
return "expand primary_view column to text"
29+
}

backend/plugins/jenkins/models/migrationscripts/register.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,6 @@ func All() []plugin.MigrationScript {
3636
new(renameTr2ScopeConfig),
3737
new(addRawParamTableForScope),
3838
new(addNumberToJenkinsBuildCommit),
39+
new(expandPrimaryView),
3940
}
4041
}

0 commit comments

Comments
 (0)