diff options
author | 6543 <6543@obermui.de> | 2020-10-13 02:01:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 20:01:57 -0400 |
commit | f4ffe8ed54cc49b8c0ca20a8aa1db6732f39a8a0 (patch) | |
tree | d731013c3489f8deda0a2c81ad4455249e9793c4 /models/user_follow.go | |
parent | f2858600af811c584c82b45efbf343b53821575b (diff) | |
download | gitea-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/user_follow.go')
-rw-r--r-- | models/user_follow.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/models/user_follow.go b/models/user_follow.go index 4bde71cb91..8321d95077 100644 --- a/models/user_follow.go +++ b/models/user_follow.go @@ -4,11 +4,16 @@ package models +import ( + "code.gitea.io/gitea/modules/timeutil" +) + // Follow represents relations of user and his/her followers. type Follow struct { - ID int64 `xorm:"pk autoincr"` - UserID int64 `xorm:"UNIQUE(follow)"` - FollowID int64 `xorm:"UNIQUE(follow)"` + ID int64 `xorm:"pk autoincr"` + UserID int64 `xorm:"UNIQUE(follow)"` + FollowID int64 `xorm:"UNIQUE(follow)"` + CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` } // IsFollowing returns true if user is following followID. |