diff --git a/backend/plugins/jenkins/models/job.go b/backend/plugins/jenkins/models/job.go index e4b5b84a645..8a5a6918f77 100644 --- a/backend/plugins/jenkins/models/job.go +++ b/backend/plugins/jenkins/models/job.go @@ -35,7 +35,7 @@ type JenkinsJob struct { Base string `gorm:"type:varchar(255)" mapstructure:"base,omitempty" json:"base"` Url string `mapstructure:"url,omitempty" json:"url"` Description string `mapstructure:"description,omitempty" json:"description"` - PrimaryView string `gorm:"type:varchar(255)" mapstructure:"primaryView,omitempty" json:"primaryView"` + PrimaryView string `gorm:"type:text" mapstructure:"primaryView,omitempty" json:"primaryView"` } func (JenkinsJob) TableName() string { diff --git a/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go b/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go new file mode 100644 index 00000000000..7644edd717e --- /dev/null +++ b/backend/plugins/jenkins/models/migrationscripts/20260602_expand_primary_view.go @@ -0,0 +1,29 @@ +package migrationscripts + +import ( + "github.com/apache/incubator-devlake/core/context" + "github.com/apache/incubator-devlake/core/errors" + "github.com/apache/incubator-devlake/helpers/migrationhelper" +) + +type expandPrimaryView struct{} + +type JenkinsJob20260602 struct { + PrimaryView string `gorm:"type:text"` +} + +func (JenkinsJob20260602) TableName() string { + return "_tool_jenkins_jobs" +} + +func (u *expandPrimaryView) Up(baseRes context.BasicRes) errors.Error { + return migrationhelper.AutoMigrateTables(baseRes, &JenkinsJob20260602{}) +} + +func (*expandPrimaryView) Version() uint64 { + return 20260602000000 +} + +func (*expandPrimaryView) Name() string { + return "expand primary_view column to text" +} \ No newline at end of file diff --git a/backend/plugins/jenkins/models/migrationscripts/register.go b/backend/plugins/jenkins/models/migrationscripts/register.go index 1dc1eb84b15..50322d0b8d1 100644 --- a/backend/plugins/jenkins/models/migrationscripts/register.go +++ b/backend/plugins/jenkins/models/migrationscripts/register.go @@ -36,5 +36,6 @@ func All() []plugin.MigrationScript { new(renameTr2ScopeConfig), new(addRawParamTableForScope), new(addNumberToJenkinsBuildCommit), + new(expandPrimaryView), } }