summaryrefslogtreecommitdiffstats
path: root/models/issue_label.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2020-10-13 02:01:57 +0200
committerGitHub <noreply@github.com>2020-10-12 20:01:57 -0400
commitf4ffe8ed54cc49b8c0ca20a8aa1db6732f39a8a0 (patch)
treed731013c3489f8deda0a2c81ad4455249e9793c4 /models/issue_label.go
parentf2858600af811c584c82b45efbf343b53821575b (diff)
downloadgitea-f4ffe8ed54cc49b8c0ca20a8aa1db6732f39a8a0.tar.gz
gitea-f4ffe8ed54cc49b8c0ca20a8aa1db6732f39a8a0.zip
Save TimeStamps for Star, Label, Follow, Watch and Collaboration to Database (#13124)
* Add timestamps to Star, Label, LanguageStat, Follow, Watch and Collaboration * Star do not need updated * LanguageStat do not need update (they wont change) * fix unit-test
Diffstat (limited to 'models/issue_label.go')
-rw-r--r--models/issue_label.go21
1 files changed, 13 insertions, 8 deletions
diff --git a/models/issue_label.go b/models/issue_label.go
index 6b029198fc..ea12b42ae6 100644
--- a/models/issue_label.go
+++ b/models/issue_label.go
@@ -12,6 +12,8 @@ import (
"strconv"
"strings"
+ "code.gitea.io/gitea/modules/timeutil"
+
"xorm.io/builder"
"xorm.io/xorm"
)
@@ -21,14 +23,17 @@ var LabelColorPattern = regexp.MustCompile("^#[0-9a-fA-F]{6}$")
// Label represents a label of repository for issues.
type Label struct {
- ID int64 `xorm:"pk autoincr"`
- RepoID int64 `xorm:"INDEX"`
- OrgID int64 `xorm:"INDEX"`
- Name string
- Description string
- Color string `xorm:"VARCHAR(7)"`
- NumIssues int
- NumClosedIssues int
+ ID int64 `xorm:"pk autoincr"`
+ RepoID int64 `xorm:"INDEX"`
+ OrgID int64 `xorm:"INDEX"`
+ Name string
+ Description string
+ Color string `xorm:"VARCHAR(7)"`
+ NumIssues int
+ NumClosedIssues int
+ CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
+ UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
+
NumOpenIssues int `xorm:"-"`
NumOpenRepoIssues int64 `xorm:"-"`
IsChecked bool `xorm:"-"`