This is an automated email from the ASF dual-hosted git repository.
lynwee pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/main by this push:
new 9c1152aad fix: increase cq_issuescomponent length to text (#8068)
9c1152aad is described below
commit 9c1152aad86b7e53fc4db4ae74726d0c7e9a901e
Author: abeizn <[email protected]>
AuthorDate: Thu Sep 19 10:35:17 2024 +0800
fix: increase cq_issuescomponent length to text (#8068)
---
.../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 6f5d2a465..6856b8f7c 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 fa349d6b3..709099d59 100644
--- a/backend/core/models/migrationscripts/register.go
+++ b/backend/core/models/migrationscripts/register.go
@@ -133,5 +133,6 @@ func All() []plugin.MigrationScript {
new(addAssigneeToIncident),
new(addIsSubtaskToIssue),
new(addIsChildToCicdPipeline),
+ new(increaseCqIssueComponentLength),
}
}