mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-23 19:47:07 +09:00
feat: optimize log indexes
This commit is contained in:
1 parent
bb4963fd4a
commit
dd5b2c5dfd
7 files changed
+59
-25
No files matched your search
+4
-4
@@ -142,9 +142,9 @@ type Repository struct {
|
||||
NumProjects int `xorm:"NOT NULL DEFAULT 0"`
|
||||
NumClosedProjects int `xorm:"NOT NULL DEFAULT 0"`
|
||||
NumOpenProjects int `xorm:"-"`
|
||||
NumBuilds int `xorm:"NOT NULL DEFAULT 0"`
|
||||
NumClosedBuilds int `xorm:"NOT NULL DEFAULT 0"`
|
||||
NumOpenBuilds int `xorm:"-"`
|
||||
NumRuns int `xorm:"NOT NULL DEFAULT 0"`
|
||||
NumClosedRuns int `xorm:"NOT NULL DEFAULT 0"`
|
||||
NumOpenRuns int `xorm:"-"`
|
||||
|
||||
IsPrivate bool `xorm:"INDEX"`
|
||||
IsEmpty bool `xorm:"INDEX"`
|
||||
@@ -237,7 +237,7 @@ func (repo *Repository) AfterLoad() {
|
||||
repo.NumOpenPulls = repo.NumPulls - repo.NumClosedPulls
|
||||
repo.NumOpenMilestones = repo.NumMilestones - repo.NumClosedMilestones
|
||||
repo.NumOpenProjects = repo.NumProjects - repo.NumClosedProjects
|
||||
repo.NumOpenBuilds = repo.NumBuilds - repo.NumClosedBuilds
|
||||
repo.NumOpenRuns = repo.NumRuns - repo.NumClosedRuns
|
||||
}
|
||||
|
||||
// LoadAttributes loads attributes of the repository.
|
||||
|
||||
Reference in new issue
Block a user