This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch fix#5519-sonarqube
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/fix#5519-sonarqube by this
push:
new 5be7f9c46 fix: sonarqube and gitee scope config id
5be7f9c46 is described below
commit 5be7f9c464f130f1c1a7fd9e178513450f5f60f3
Author: abeizn <[email protected]>
AuthorDate: Sat Oct 7 14:01:03 2023 +0800
fix: sonarqube and gitee scope config id
---
.../migrationscripts/20230922_add_scope_config_id.go | 2 +-
.../migrationscripts/20230922_add_scope_config_id.go | 20 +++++++++-----------
.../sonarqube/models/migrationscripts/register.go | 1 +
3 files changed, 11 insertions(+), 12 deletions(-)
diff --git
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
b/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
index 14bc9ff12..1b7a8dba2 100644
---
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
+++
b/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
@@ -31,7 +31,7 @@ type giteeRepo20230922 struct {
}
func (giteeRepo20230922) TableName() string {
- return "_raw_gitee_api_repo"
+ return "_tool_gitee_repos"
}
type addScopeConfigIdToRepo struct{}
diff --git
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
b/backend/plugins/sonarqube/models/migrationscripts/20230922_add_scope_config_id.go
similarity index 73%
copy from
backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
copy to
backend/plugins/sonarqube/models/migrationscripts/20230922_add_scope_config_id.go
index 14bc9ff12..813c36dc5 100644
---
a/backend/plugins/gitee/models/migrationscripts/20230922_add_scope_config_id.go
+++
b/backend/plugins/sonarqube/models/migrationscripts/20230922_add_scope_config_id.go
@@ -5,9 +5,7 @@ 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.
@@ -24,30 +22,30 @@ import (
"github.com/apache/incubator-devlake/helpers/migrationhelper"
)
-var _ plugin.MigrationScript = (*addScopeConfigIdToRepo)(nil)
+var _ plugin.MigrationScript = (*addScopeConfigIdToProject)(nil)
-type giteeRepo20230922 struct {
+type sonarqubeProject20230922 struct {
ScopeConfigId uint64 `json:"scopeConfigId,omitempty"
mapstructure:"scopeConfigId,omitempty"`
}
-func (giteeRepo20230922) TableName() string {
- return "_raw_gitee_api_repo"
+func (sonarqubeProject20230922) TableName() string {
+ return "_tool_sonarqube_projects"
}
-type addScopeConfigIdToRepo struct{}
+type addScopeConfigIdToProject struct{}
-func (script *addScopeConfigIdToRepo) Up(basicRes context.BasicRes)
errors.Error {
+func (script *addScopeConfigIdToProject) Up(basicRes context.BasicRes)
errors.Error {
return migrationhelper.AutoMigrateTables(
basicRes,
- &giteeRepo20230922{},
+ &sonarqubeProject20230922{},
)
}
-func (*addScopeConfigIdToRepo) Version() uint64 {
+func (*addScopeConfigIdToProject) Version() uint64 {
return 20230922152829
}
-func (*addScopeConfigIdToRepo) Name() string {
+func (*addScopeConfigIdToProject) Name() string {
return "add scope_config_id to _tool_gitee_repos table"
}
diff --git a/backend/plugins/sonarqube/models/migrationscripts/register.go
b/backend/plugins/sonarqube/models/migrationscripts/register.go
index 9a4047464..0626cf45d 100644
--- a/backend/plugins/sonarqube/models/migrationscripts/register.go
+++ b/backend/plugins/sonarqube/models/migrationscripts/register.go
@@ -26,6 +26,7 @@ func All() []plugin.MigrationScript {
new(modifyCharacterSet),
new(expandProjectKey20230206),
new(addRawParamTableForScope),
+ new(addScopeConfigIdToProject),
new(modifyFileMetricsKeyLength),
}
}