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/repo_collaboration.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/repo_collaboration.go')
-rw-r--r-- | models/repo_collaboration.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/models/repo_collaboration.go b/models/repo_collaboration.go index 4bb95cd05c..b9488f5e2e 100644 --- a/models/repo_collaboration.go +++ b/models/repo_collaboration.go @@ -8,15 +8,19 @@ package models import ( "fmt" + "code.gitea.io/gitea/modules/timeutil" + "xorm.io/builder" ) // Collaboration represent the relation between an individual and a repository. type Collaboration struct { - ID int64 `xorm:"pk autoincr"` - RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` - UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` - Mode AccessMode `xorm:"DEFAULT 2 NOT NULL"` + ID int64 `xorm:"pk autoincr"` + RepoID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` + UserID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"` + Mode AccessMode `xorm:"DEFAULT 2 NOT NULL"` + CreatedUnix timeutil.TimeStamp `xorm:"INDEX created"` + UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"` } func (repo *Repository) addCollaborator(e Engine, u *User) error { |