This is an automated email from the ASF dual-hosted git repository. klesh pushed a commit to branch kw-7852-components-field-length in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 12253ce41138df44c442bf00f2a5b5028fa1fe8c Author: Klesh Wong <[email protected]> AuthorDate: Tue Aug 13 15:41:29 2024 +0800 fix: change issue.components to text to avoid data too long error --- backend/core/models/domainlayer/ticket/issue.go | 2 +- .../20240813_change_issue_component_type.go | 40 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/backend/core/models/domainlayer/ticket/issue.go b/backend/core/models/domainlayer/ticket/issue.go index 278b2f825..f7d5cc562 100644 --- a/backend/core/models/domainlayer/ticket/issue.go +++ b/backend/core/models/domainlayer/ticket/issue.go @@ -51,7 +51,7 @@ type Issue struct { Priority string `gorm:"type:varchar(255)"` Severity string `gorm:"type:varchar(255)"` Urgency string `gorm:"type:varchar(255)"` - Component string `gorm:"type:varchar(255)"` + Component string `gorm:"type:text"` OriginalProject string `gorm:"type:varchar(255)"` IsSubtask bool } diff --git a/backend/core/models/migrationscripts/20240813_change_issue_component_type.go b/backend/core/models/migrationscripts/20240813_change_issue_component_type.go new file mode 100644 index 000000000..8f7a2f2fe --- /dev/null +++ b/backend/core/models/migrationscripts/20240813_change_issue_component_type.go @@ -0,0 +1,40 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one or more +contributor license agreements. See the NOTICE file distributed with +this work for additional information regarding copyright ownership. +The ASF licenses this file to You under the Apache License, Version 2.0 +(the "License"); you may not use this file except in compliance with +the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package migrationscripts + +import ( + "github.com/apache/incubator-devlake/core/context" + "github.com/apache/incubator-devlake/core/errors" + "github.com/apache/incubator-devlake/core/plugin" +) + +var _ plugin.MigrationScript = (*changeIssueComponentType)(nil) + +type changeIssueComponentType struct{} + +func (script *changeIssueComponentType) Up(basicRes context.BasicRes) errors.Error { + return basicRes.GetDal().ModifyColumnType("issues", "components", "text") +} + +func (*changeIssueComponentType) Version() uint64 { + return 20240813153901 +} + +func (*changeIssueComponentType) Name() string { + return "change issues.components type to text" +}
