Skip to content

Commit e1ad6ae

Browse files
committed
fix(jira): widen _tool_jira_issues.fix_versions column to text
The fix_versions column in _tool_jira_issues was originally created as varchar(255) by migration 20250619, but the JiraIssue model was later changed to type:text without a corresponding migration to alter the existing column. On existing databases the column stayed varchar(255), causing the extractIssues subtask to fail when an issue's joined fix-version names exceed 255 characters: Error 1406 (22001): Data too long for column 'fix_versions' Add migration 20260707_change_fix_versions_to_text to alter the column to text, matching the model definition and the domain-layer issues table, and register it in migrationscripts/register.go.
1 parent 2050954 commit e1ad6ae

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
*/
17+
18+
package migrationscripts
19+
20+
import (
21+
"github.com/apache/incubator-devlake/core/context"
22+
"github.com/apache/incubator-devlake/core/errors"
23+
"github.com/apache/incubator-devlake/helpers/migrationhelper"
24+
)
25+
26+
type jiraIssue20260707 struct {
27+
FixVersions string `gorm:"type:text;column:fix_versions"`
28+
}
29+
30+
func (jiraIssue20260707) TableName() string {
31+
return "_tool_jira_issues"
32+
}
33+
34+
type changeFixVersionsToText20260707 struct{}
35+
36+
func (script *changeFixVersionsToText20260707) Up(basicRes context.BasicRes) errors.Error {
37+
return migrationhelper.AutoMigrateTables(basicRes, &jiraIssue20260707{})
38+
}
39+
40+
func (*changeFixVersionsToText20260707) Version() uint64 {
41+
return 20260707140000
42+
}
43+
44+
func (*changeFixVersionsToText20260707) Name() string {
45+
return "change fix_versions type to text in _tool_jira_issues"
46+
}
47+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@ func All() []plugin.MigrationScript {
5656
new(updateScopeConfig),
5757
new(addFixVersions20250619),
5858
new(addSubQueryToBoards),
59+
new(changeFixVersionsToText20260707),
5960
}
6061
}

0 commit comments

Comments
 (0)