This is an automated email from the ASF dual-hosted git repository. narro pushed a commit to branch #8452 in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 111a6875769651705a760119828c48e7c474f9d3 Author: abeizn <[email protected]> AuthorDate: Thu Sep 19 09:59:36 2024 +0800 fix: increase cq_issuescomponent length to text --- .../models/domainlayer/codequality/cq_issues.go | 2 +- .../20240919_increase_cq_issue_component_length.go | 40 ++++++++++++++++++++++ backend/core/models/migrationscripts/register.go | 1 + 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/backend/core/models/domainlayer/codequality/cq_issues.go b/backend/core/models/domainlayer/codequality/cq_issues.go index 243e675fa..1e9ea7134 100644 --- a/backend/core/models/domainlayer/codequality/cq_issues.go +++ b/backend/core/models/domainlayer/codequality/cq_issues.go @@ -26,7 +26,7 @@ type CqIssue struct { domainlayer.DomainEntity Rule string `gorm:"type:varchar(255)"` Severity string `gorm:"type:varchar(100)"` - Component string `gorm:"type:varchar(255)"` + Component string ProjectKey string `gorm:"index;type:varchar(100)"` //domain project key Line int Status string `gorm:"type:varchar(20)"` diff --git a/backend/core/models/migrationscripts/20240919_increase_cq_issue_component_length.go b/backend/core/models/migrationscripts/20240919_increase_cq_issue_component_length.go new file mode 100644 index 000000000..aa1483e06 --- /dev/null +++ b/backend/core/models/migrationscripts/20240919_increase_cq_issue_component_length.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 = (*increaseCqIssueComponentLength)(nil) + +type increaseCqIssueComponentLength struct{} + +func (script *increaseCqIssueComponentLength) Up(basicRes context.BasicRes) errors.Error { + return basicRes.GetDal().ModifyColumnType("cq_issues", "component", "text") +} + +func (*increaseCqIssueComponentLength) Version() uint64 { + return 20240919160242 +} + +func (*increaseCqIssueComponentLength) Name() string { + return "increase cq_issues.component length to text" +} diff --git a/backend/core/models/migrationscripts/register.go b/backend/core/models/migrationscripts/register.go index 4886f66a4..191d0817b 100644 --- a/backend/core/models/migrationscripts/register.go +++ b/backend/core/models/migrationscripts/register.go @@ -136,5 +136,6 @@ func All() []plugin.MigrationScript { new(addCqIssueImpacts), new(addDueDateToIssues), new(createQaTables), + new(increaseCqIssueComponentLength), } }
