summaryrefslogtreecommitdiffstats
path: root/models/repo_watch.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/repo_watch.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/repo_watch.go')
-rw-r--r--models/repo_watch.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/models/repo_watch.go b/models/repo_watch.go
index 6cdf9b2af5..0e4645f26f 100644
--- a/models/repo_watch.go
+++ b/models/repo_watch.go
@@ -8,6 +8,7 @@ import (
"fmt"
"code.gitea.io/gitea/modules/setting"
+ "code.gitea.io/gitea/modules/timeutil"
)
// RepoWatchMode specifies what kind of watch the user has on a repository
@@ -26,10 +27,12 @@ const (
// Watch is connection request for receiving repository notification.
type Watch struct {
- ID int64 `xorm:"pk autoincr"`
- UserID int64 `xorm:"UNIQUE(watch)"`
- RepoID int64 `xorm:"UNIQUE(watch)"`
- Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"`
+ ID int64 `xorm:"pk autoincr"`
+ UserID int64 `xorm:"UNIQUE(watch)"`
+ RepoID int64 `xorm:"UNIQUE(watch)"`
+ Mode RepoWatchMode `xorm:"SMALLINT NOT NULL DEFAULT 1"`
+ CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"`
+ UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
}
// getWatch gets what kind of subscription a user has on a given repository; returns dummy record if none found