mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-12-30 04:10:32 +00:00
Stable sort order for DB lists (#1702)
This commit is contained in:
parent
c40a6d884f
commit
a06d3e1a61
3 changed files with 3 additions and 3 deletions
|
@ -28,7 +28,7 @@ func (s storage) RegistryFind(repo *model.Repo, addr string) (*model.Registry, e
|
|||
|
||||
func (s storage) RegistryList(repo *model.Repo) ([]*model.Registry, error) {
|
||||
regs := make([]*model.Registry, 0, perPage)
|
||||
return regs, s.engine.Where("registry_repo_id = ?", repo.ID).Find(®s)
|
||||
return regs, s.engine.OrderBy("registry_id").Where("registry_repo_id = ?", repo.ID).Find(®s)
|
||||
}
|
||||
|
||||
func (s storage) RegistryCreate(registry *model.Registry) error {
|
||||
|
|
|
@ -71,7 +71,7 @@ func (s storage) OrgSecretFind(owner, name string) (*model.Secret, error) {
|
|||
|
||||
func (s storage) OrgSecretList(owner string) ([]*model.Secret, error) {
|
||||
secrets := make([]*model.Secret, 0, perPage)
|
||||
return secrets, s.engine.Where("secret_owner = ?", owner).Find(&secrets)
|
||||
return secrets, s.engine.Where("secret_owner = ?", owner).OrderBy(orderSecretsBy).Find(&secrets)
|
||||
}
|
||||
|
||||
func (s storage) GlobalSecretFind(name string) (*model.Secret, error) {
|
||||
|
|
|
@ -30,7 +30,7 @@ func (s storage) GetUserLogin(login string) (*model.User, error) {
|
|||
|
||||
func (s storage) GetUserList() ([]*model.User, error) {
|
||||
users := make([]*model.User, 0, 10)
|
||||
return users, s.engine.Find(&users)
|
||||
return users, s.engine.OrderBy("user_id").Find(&users)
|
||||
}
|
||||
|
||||
func (s storage) GetUserCount() (int64, error) {
|
||||
|
|
Loading…
Reference in a new issue