This is an automated email from the ASF dual-hosted git repository.
abeizn 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 b71188198 fix: fix zentao migration script (#5414)
b71188198 is described below
commit b71188198714f88cdf94499706e9b008b19d507a
Author: mappjzc <[email protected]>
AuthorDate: Fri Jun 9 15:46:42 2023 +0800
fix: fix zentao migration script (#5414)
Fix addInitChangelogTables about ZentaoChangelog product type.
Nddtfjiang <[email protected]>
---
backend/plugins/zentao/models/archived/changelog.go | 2 +-
..._changelog_tables.go => 20230608_add_init_changelog_tables.go} | 8 ++++----
backend/plugins/zentao/models/migrationscripts/register.go | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/backend/plugins/zentao/models/archived/changelog.go
b/backend/plugins/zentao/models/archived/changelog.go
index 2eddfe970..0e7f196b0 100644
--- a/backend/plugins/zentao/models/archived/changelog.go
+++ b/backend/plugins/zentao/models/archived/changelog.go
@@ -34,7 +34,7 @@ type ZentaoChangelog struct {
Extra string `json:"extra" mapstructure:"extra"`
ObjectType string `json:"objectType"
mapstructure:"objectType"`
Project int `json:"project" mapstructure:"project"`
- Product string `json:"product" mapstructure:"product"`
+ Product int `json:"product" mapstructure:"product"`
Vision string `json:"vision" mapstructure:"vision"`
Comment string `json:"comment" mapstructure:"comment"`
Efforted string `json:"efforted" mapstructure:"efforted"`
diff --git
a/backend/plugins/zentao/models/migrationscripts/20230519_add_init_changelog_tables.go
b/backend/plugins/zentao/models/migrationscripts/20230608_add_init_changelog_tables.go
similarity index 93%
rename from
backend/plugins/zentao/models/migrationscripts/20230519_add_init_changelog_tables.go
rename to
backend/plugins/zentao/models/migrationscripts/20230608_add_init_changelog_tables.go
index dcdd79628..ffd4f25f7 100644
---
a/backend/plugins/zentao/models/migrationscripts/20230519_add_init_changelog_tables.go
+++
b/backend/plugins/zentao/models/migrationscripts/20230608_add_init_changelog_tables.go
@@ -27,14 +27,14 @@ import (
type addInitChangelogTables struct{}
// This object conforms to what the frontend currently sends.
-type ZentaoConnection20230522 struct {
+type ZentaoConnection20230608 struct {
DbUrl string `mapstructure:"dbUrl" json:"dbUrl"
gorm:"serializer:encdec"`
DbIdleConns int `json:"dbIdleConns" mapstructure:"dbIdleConns"`
DbLoggingLevel string `json:"dbLoggingLevel"
mapstructure:"dbLoggingLevel"`
DbMaxConns int `json:"dbMaxConns" mapstructure:"dbMaxConns"`
}
-func (ZentaoConnection20230522) TableName() string {
+func (ZentaoConnection20230608) TableName() string {
return "_tool_zentao_connections"
}
@@ -51,12 +51,12 @@ func (*addInitChangelogTables) Up(basicRes
context.BasicRes) errors.Error {
basicRes,
&archived.ZentaoChangelog{},
&archived.ZentaoChangelogDetail{},
- &ZentaoConnection20230522{},
+ &ZentaoConnection20230608{},
)
}
func (*addInitChangelogTables) Version() uint64 {
- return 20230530000002
+ return 20230608000001
}
func (*addInitChangelogTables) Name() string {
diff --git a/backend/plugins/zentao/models/migrationscripts/register.go
b/backend/plugins/zentao/models/migrationscripts/register.go
index 9ce9af76c..a5222c4a3 100644
--- a/backend/plugins/zentao/models/migrationscripts/register.go
+++ b/backend/plugins/zentao/models/migrationscripts/register.go
@@ -25,8 +25,8 @@ import (
func All() []plugin.MigrationScript {
return []plugin.MigrationScript{
new(addInitTables),
- new(addInitChangelogTables),
new(addScopeConfigTables),
new(addIssueRepoCommitsTables),
+ new(addInitChangelogTables),
}
}