mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
* make releases faster than before and resolved #490 * fix comment
This commit is contained in:
@@ -22,12 +22,12 @@ import (
|
||||
|
||||
// Release represents a release of repository.
|
||||
type Release struct {
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64
|
||||
ID int64 `xorm:"pk autoincr"`
|
||||
RepoID int64 `xorm:"index unique(n)"`
|
||||
Repo *Repository `xorm:"-"`
|
||||
PublisherID int64
|
||||
Publisher *User `xorm:"-"`
|
||||
TagName string
|
||||
Publisher *User `xorm:"-"`
|
||||
TagName string `xorm:"index unique(n)"`
|
||||
LowerTagName string
|
||||
Target string
|
||||
Title string
|
||||
@@ -213,6 +213,15 @@ func GetReleasesByRepoID(repoID int64, page, pageSize int) (rels []*Release, err
|
||||
return rels, err
|
||||
}
|
||||
|
||||
// GetReleasesByRepoIDAndNames returns a list of releases of repository accroding repoID and tagNames.
|
||||
func GetReleasesByRepoIDAndNames(repoID int64, tagNames []string) (rels []*Release, err error) {
|
||||
err = x.
|
||||
Desc("created_unix").
|
||||
In("tag_name", tagNames).
|
||||
Find(&rels, Release{RepoID: repoID})
|
||||
return rels, err
|
||||
}
|
||||
|
||||
type releaseSorter struct {
|
||||
rels []*Release
|
||||
}
|
||||
|
Reference in New Issue
Block a user