summaryrefslogtreecommitdiffstats
path: root/models/release.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2021-12-10 09:27:50 +0800
committerGitHub <noreply@github.com>2021-12-10 09:27:50 +0800
commit719bddcd76610a63dadc8555760072957a11cf30 (patch)
tree0df26092fba7e3e21444fe493e6b349473b6b0cb /models/release.go
parentfb8166c6c6b652a0e6fa98681780a6a71090faf3 (diff)
downloadgitea-719bddcd76610a63dadc8555760072957a11cf30.tar.gz
gitea-719bddcd76610a63dadc8555760072957a11cf30.zip
Move repository model into models/repo (#17933)
* Some refactors related repository model * Move more methods out of repository * Move repository into models/repo * Fix test * Fix test * some improvements * Remove unnecessary function
Diffstat (limited to 'models/release.go')
-rw-r--r--models/release.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/models/release.go b/models/release.go
index f60024c710..a19d4f937f 100644
--- a/models/release.go
+++ b/models/release.go
@@ -25,12 +25,12 @@ import (
// Release represents a release of repository.
type Release struct {
- ID int64 `xorm:"pk autoincr"`
- RepoID int64 `xorm:"INDEX UNIQUE(n)"`
- Repo *Repository `xorm:"-"`
- PublisherID int64 `xorm:"INDEX"`
- Publisher *user_model.User `xorm:"-"`
- TagName string `xorm:"INDEX UNIQUE(n)"`
+ ID int64 `xorm:"pk autoincr"`
+ RepoID int64 `xorm:"INDEX UNIQUE(n)"`
+ Repo *repo_model.Repository `xorm:"-"`
+ PublisherID int64 `xorm:"INDEX"`
+ Publisher *user_model.User `xorm:"-"`
+ TagName string `xorm:"INDEX UNIQUE(n)"`
OriginalAuthor string
OriginalAuthorID int64 `xorm:"index"`
LowerTagName string
@@ -55,7 +55,7 @@ func init() {
func (r *Release) loadAttributes(e db.Engine) error {
var err error
if r.Repo == nil {
- r.Repo, err = GetRepositoryByID(r.RepoID)
+ r.Repo, err = repo_model.GetRepositoryByID(r.RepoID)
if err != nil {
return err
}