This is an automated email from the ASF dual-hosted git repository.
zky 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 9d6baa6a3 fix: dora benchmark metric value (#6737)
9d6baa6a3 is described below
commit 9d6baa6a3443f48634b0608d14b978afc0ea4e42
Author: abeizn <[email protected]>
AuthorDate: Thu Jan 4 17:28:01 2024 +0800
fix: dora benchmark metric value (#6737)
---
...er.go => 20240104_fix_dora_benchmark_metric.go} | 22 ++++++++++++++++------
.../dora/models/migrationscripts/register.go | 1 +
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/backend/plugins/dora/models/migrationscripts/register.go
b/backend/plugins/dora/models/migrationscripts/20240104_fix_dora_benchmark_metric.go
similarity index 61%
copy from backend/plugins/dora/models/migrationscripts/register.go
copy to
backend/plugins/dora/models/migrationscripts/20240104_fix_dora_benchmark_metric.go
index ef96ffbeb..6646f5baa 100644
--- a/backend/plugins/dora/models/migrationscripts/register.go
+++
b/backend/plugins/dora/models/migrationscripts/20240104_fix_dora_benchmark_metric.go
@@ -18,12 +18,22 @@ limitations under the License.
package migrationscripts
import (
- "github.com/apache/incubator-devlake/core/plugin"
+ "github.com/apache/incubator-devlake/core/context"
+ "github.com/apache/incubator-devlake/core/errors"
)
-// All return all the migration scripts
-func All() []plugin.MigrationScript {
- return []plugin.MigrationScript{
- new(addDoraBenchmark),
- }
+type fixDoraBenchmarkMetric struct{}
+
+func (u *fixDoraBenchmarkMetric) Up(baseRes context.BasicRes) errors.Error {
+ db := baseRes.GetDal()
+ return db.Exec("UPDATE dora_benchmarks SET metric = 'Deployment
frequency' WHERE id = 1")
+
+}
+
+func (*fixDoraBenchmarkMetric) Version() uint64 {
+ return 20240104000002
+}
+
+func (*fixDoraBenchmarkMetric) Name() string {
+ return "fix dora benchmark metric"
}
diff --git a/backend/plugins/dora/models/migrationscripts/register.go
b/backend/plugins/dora/models/migrationscripts/register.go
index ef96ffbeb..1d7fb7bf8 100644
--- a/backend/plugins/dora/models/migrationscripts/register.go
+++ b/backend/plugins/dora/models/migrationscripts/register.go
@@ -25,5 +25,6 @@ import (
func All() []plugin.MigrationScript {
return []plugin.MigrationScript{
new(addDoraBenchmark),
+ new(fixDoraBenchmarkMetric),
}
}