You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by zh...@apache.org on 2022/10/12 07:32:30 UTC
[incubator-devlake] branch main updated: fix: issues and pull_requests cached plan must not change result type (#3383)
This is an automated email from the ASF dual-hosted git repository.
zhangliang2022 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 bb4d44c2 fix: issues and pull_requests cached plan must not change result type (#3383)
bb4d44c2 is described below
commit bb4d44c2bbe4ba904a45065c9b40eb6947e53b54
Author: abeizn <zi...@merico.dev>
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)
}