From f4ffe8ed54cc49b8c0ca20a8aa1db6732f39a8a0 Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Tue, 13 Oct 2020 02:01:57 +0200 Subject: 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 --- models/user_follow.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'models/user_follow.go') 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. -- cgit v1.2.3