diff options
Diffstat (limited to 'models/repo_unit.go')
-rw-r--r-- | models/repo_unit.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/models/repo_unit.go b/models/repo_unit.go index 2a20205fe4..c35312be60 100644 --- a/models/repo_unit.go +++ b/models/repo_unit.go @@ -7,6 +7,7 @@ package models import ( "fmt" + "code.gitea.io/gitea/models/db" "code.gitea.io/gitea/modules/json" "code.gitea.io/gitea/modules/timeutil" @@ -23,6 +24,10 @@ type RepoUnit struct { CreatedUnix timeutil.TimeStamp `xorm:"INDEX CREATED"` } +func init() { + db.RegisterModel(new(RepoUnit)) +} + // UnitConfig describes common unit config type UnitConfig struct{} @@ -200,7 +205,7 @@ func (r *RepoUnit) ExternalTrackerConfig() *ExternalTrackerConfig { return r.Config.(*ExternalTrackerConfig) } -func getUnitsByRepoID(e Engine, repoID int64) (units []*RepoUnit, err error) { +func getUnitsByRepoID(e db.Engine, repoID int64) (units []*RepoUnit, err error) { var tmpUnits []*RepoUnit if err := e.Where("repo_id = ?", repoID).Find(&tmpUnits); err != nil { return nil, err |