This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch release-v0.14
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/release-v0.14 by this push:
new a8c2cc8b fix: issues and pull_requests cached plan must not change
result type (#3383)
a8c2cc8b is described below
commit a8c2cc8bac0e79aa7bd1f99714f531cb3426fd31
Author: abeizn <[email protected]>
AuthorDate: Wed Oct 12 15:32:21 2022 +0800
fix: issues and pull_requests cached plan must not change result type
(#3383)
---
.../20220913_add_origin_value_for_pr.go | 21 ++++++++++++++++++---
.../20220929_modify_lead_time_minutes.go | 2 +-
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/models/migrationscripts/20220913_add_origin_value_for_pr.go
b/models/migrationscripts/20220913_add_origin_value_for_pr.go
index 46f3a4c5..80959310 100644
--- a/models/migrationscripts/20220913_add_origin_value_for_pr.go
+++ b/models/migrationscripts/20220913_add_origin_value_for_pr.go
@@ -19,6 +19,7 @@ package migrationscripts
import (
"context"
+
"github.com/apache/incubator-devlake/errors"
"gorm.io/gorm"
)
@@ -26,9 +27,23 @@ import (
type addOriginChangeValueForPr struct{}
func (*addOriginChangeValueForPr) Up(ctx context.Context, db *gorm.DB)
errors.Error {
- err := db.Migrator().AutoMigrate(
- &PullRequest0913{},
- )
+ err := db.Migrator().AddColumn(PullRequest0913{},
"orig_coding_timespan")
+ if err != nil {
+ return errors.Convert(err)
+ }
+ err = db.Migrator().AddColumn(PullRequest0913{}, "orig_review_lag")
+ if err != nil {
+ return errors.Convert(err)
+ }
+ err = db.Migrator().AddColumn(PullRequest0913{}, "orig_review_timespan")
+ if err != nil {
+ return errors.Convert(err)
+ }
+ err = db.Migrator().AddColumn(PullRequest0913{}, "orig_deploy_timespan")
+ if err != nil {
+ return errors.Convert(err)
+ }
+
if err != nil {
return errors.Convert(err)
}
diff --git a/models/migrationscripts/20220929_modify_lead_time_minutes.go
b/models/migrationscripts/20220929_modify_lead_time_minutes.go
index ed03d11e..28f8035a 100644
--- a/models/migrationscripts/20220929_modify_lead_time_minutes.go
+++ b/models/migrationscripts/20220929_modify_lead_time_minutes.go
@@ -39,7 +39,7 @@ func (*modifyLeadTimeMinutes) Up(ctx context.Context, db
*gorm.DB) errors.Error
if err != nil {
return errors.Convert(err)
}
- err = db.Migrator().AutoMigrate(&newIssue{})
+ err = db.Migrator().AddColumn(newIssue{}, "lead_time_minutes")
if err != nil {
return errors.Convert(err)
}