You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by na...@apache.org on 2025/03/03 02:42:02 UTC

(incubator-devlake) branch feat/due_date created (now 3d81b0de7)

This is an automated email from the ASF dual-hosted git repository.

narro pushed a change to branch feat/due_date
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


      at 3d81b0de7 feat: add DueDate field to Issue model and migration script

This branch includes the following new commits:

     new 3d81b0de7 feat: add DueDate field to Issue model and migration script

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(incubator-devlake) 01/01: feat: add DueDate field to Issue model and migration script

Posted by na...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

narro pushed a commit to branch feat/due_date
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 3d81b0de72cc55534e95f647265c29fb7d343698
Author: narro wizard <co...@merico.dev>
AuthorDate: Mon Mar 3 10:41:47 2025 +0800

    feat: add DueDate field to Issue model and migration script
    
    #8315
---
 backend/core/models/domainlayer/ticket/issue.go    |  1 +
 .../20250303_add_due_date_to_issues.go             | 54 ++++++++++++++++++++++
 backend/core/models/migrationscripts/register.go   |  1 +
 3 files changed, 56 insertions(+)

diff --git a/backend/core/models/domainlayer/ticket/issue.go b/backend/core/models/domainlayer/ticket/issue.go
index f7d5cc562..e546ded25 100644
--- a/backend/core/models/domainlayer/ticket/issue.go
+++ b/backend/core/models/domainlayer/ticket/issue.go
@@ -54,6 +54,7 @@ type Issue struct {
 	Component               string `gorm:"type:text"`
 	OriginalProject         string `gorm:"type:varchar(255)"`
 	IsSubtask               bool
+	DueDate                 *time.Time
 }
 
 func (Issue) TableName() string {
diff --git a/backend/core/models/migrationscripts/20250303_add_due_date_to_issues.go b/backend/core/models/migrationscripts/20250303_add_due_date_to_issues.go
new file mode 100644
index 000000000..ae6f12e77
--- /dev/null
+++ b/backend/core/models/migrationscripts/20250303_add_due_date_to_issues.go
@@ -0,0 +1,54 @@
+/*
+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 (
+	"time"
+
+	"github.com/apache/incubator-devlake/core/context"
+	"github.com/apache/incubator-devlake/core/errors"
+	"github.com/apache/incubator-devlake/core/plugin"
+)
+
+var _ plugin.MigrationScript = (*addDueDateToIssues)(nil)
+
+type issue20250303 struct {
+	DueDate *time.Time
+}
+
+func (issue20250303) TableName() string {
+	return "issues"
+}
+
+type addDueDateToIssues struct{}
+
+func (*addDueDateToIssues) Up(basicRes context.BasicRes) errors.Error {
+	db := basicRes.GetDal()
+	if err := db.AutoMigrate(&issue20250303{}); err != nil {
+		return err
+	}
+	return nil
+}
+
+func (*addDueDateToIssues) Version() uint64 {
+	return 20250303142101
+}
+
+func (*addDueDateToIssues) Name() string {
+	return "add due_date to issues"
+}
diff --git a/backend/core/models/migrationscripts/register.go b/backend/core/models/migrationscripts/register.go
index 036dbf130..b22feede5 100644
--- a/backend/core/models/migrationscripts/register.go
+++ b/backend/core/models/migrationscripts/register.go
@@ -137,5 +137,6 @@ func All() []plugin.MigrationScript {
 		new(addCqIssueImpacts),
 		new(changeIssueComponentType),
 		new(increaseCqProjectsIdLength),
+		new(addDueDateToIssues),
 	}
 }