This is an automated email from the ASF dual-hosted git repository.
abeizn pushed a commit to branch feat#5868
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
The following commit(s) were added to refs/heads/feat#5868 by this push:
new af6889405 feat: add issue custom array field
af6889405 is described below
commit af68894052640d4ce0b3e035a094ab23e908aaa2
Author: abeizn <[email protected]>
AuthorDate: Thu Sep 21 15:48:59 2023 +0800
feat: add issue custom array field
---
.../20230921_add_issue_custom_array_fields.go | 43 ++++++++++++++++++++++
.../archived/issue_custom_array_fields.go | 30 +++++++++++++++
backend/core/models/migrationscripts/register.go | 1 +
3 files changed, 74 insertions(+)
diff --git
a/backend/core/models/migrationscripts/20230921_add_issue_custom_array_fields.go
b/backend/core/models/migrationscripts/20230921_add_issue_custom_array_fields.go
new file mode 100644
index 000000000..378f76e8d
--- /dev/null
+++
b/backend/core/models/migrationscripts/20230921_add_issue_custom_array_fields.go
@@ -0,0 +1,43 @@
+/*
+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/models/migrationscripts/archived"
+ "github.com/apache/incubator-devlake/helpers/migrationhelper"
+)
+
+type addIssueCustomArrayField struct{}
+
+func (u *addIssueCustomArrayField) Up(basicRes context.BasicRes) errors.Error {
+
+ return migrationhelper.AutoMigrateTables(
+ basicRes,
+ &archived.IssueCustomArrayField{},
+ )
+}
+
+func (*addIssueCustomArrayField) Version() uint64 {
+ return 20230921000083
+}
+
+func (*addIssueCustomArrayField) Name() string {
+ return "add issue custom array field"
+}
diff --git
a/backend/core/models/migrationscripts/archived/issue_custom_array_fields.go
b/backend/core/models/migrationscripts/archived/issue_custom_array_fields.go
new file mode 100644
index 000000000..9328ecafa
--- /dev/null
+++ b/backend/core/models/migrationscripts/archived/issue_custom_array_fields.go
@@ -0,0 +1,30 @@
+/*
+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 archived
+
+type IssueCustomArrayField struct {
+ IssueId string `gorm:"primaryKey;type:varchar(255)"`
+ FieldId string `gorm:"primaryKey;type:varchar(255)"`
+ FieldValue string `gorm:"primaryKey;type:varchar(255)"`
+
+ NoPKModel
+}
+
+func (IssueCustomArrayField) TableName() string {
+ return "issue_custom_array_fields"
+}
diff --git a/backend/core/models/migrationscripts/register.go
b/backend/core/models/migrationscripts/register.go
index 3874e9d91..647a27020 100644
--- a/backend/core/models/migrationscripts/register.go
+++ b/backend/core/models/migrationscripts/register.go
@@ -94,5 +94,6 @@ func All() []plugin.MigrationScript {
new(addCICDDeploymentsTable),
new(normalizeBpSettings),
new(addSyncPolicy),
+ new(addIssueCustomArrayField),
}
}