Skip to content

Commit

Permalink
fix(plugins): add missing column connection_id to `_tool_sonarqube_…
Browse files Browse the repository at this point in the history
…scope_configs` and `_tool_opsgenie_scope_configs`
  • Loading branch information
d4x1 committed Jun 14, 2024
1 parent 3fcaa25 commit d80951a
Show file tree
Hide file tree
Showing 4 changed files with 98 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
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 = (*updateOpsenieScopeConfig20240614)(nil)

type OpsenieScopeConfig20240614 struct {
ConnectionId uint64 `json:"connectionId" gorm:"index" validate:"required" mapstructure:"connectionId,omitempty"`
}

func (o OpsenieScopeConfig20240614) TableName() string {
return "_tool_opsgenie_scope_configs"
}

type updateOpsenieScopeConfig20240614 struct{}

func (script *updateOpsenieScopeConfig20240614) Up(basicRes context.BasicRes) errors.Error {
return basicRes.GetDal().AutoMigrate(&OpsenieScopeConfig20240614{})
}

func (*updateOpsenieScopeConfig20240614) Version() uint64 {
return 20240614110000
}

func (script *updateOpsenieScopeConfig20240614) Name() string {
return "add connection_id column to table _tool_opsgenie_scope_configs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func All() []plugin.MigrationScript {
new(renameTr2ScopeConfig),
new(removeScopeConfig),
new(addOpsenieScopeConfig20231214),
new(updateOpsenieScopeConfig20240614),
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
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 = (*updateSonarQubeScopeConfig20240614)(nil)

type SonarQubeScopeConfig20240614 struct {
ConnectionId uint64 `json:"connectionId" gorm:"index" validate:"required" mapstructure:"connectionId,omitempty"`
}

func (o SonarQubeScopeConfig20240614) TableName() string {
return "_tool_sonarqube_scope_configs"
}

type updateSonarQubeScopeConfig20240614 struct{}

func (script *updateSonarQubeScopeConfig20240614) Up(basicRes context.BasicRes) errors.Error {
return basicRes.GetDal().AutoMigrate(&SonarQubeScopeConfig20240614{})
}

func (*updateSonarQubeScopeConfig20240614) Version() uint64 {
return 20240614111000
}

func (script *updateSonarQubeScopeConfig20240614) Name() string {
return "add connection_id to table _tool_sonarqube_scope_configs"
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,6 @@ func All() []plugin.MigrationScript {
new(addSonarQubeScopeConfig20231214),
new(modifyCommitCharacterType),
new(modifyCommitCharacterType0508),
new(updateSonarQubeScopeConfig20240614),
}
}

0 comments on commit d80951a

Please sign in to comment.