@@ -13,17 +13,6 @@ import (
13
13
"github.com/go-xorm/xorm"
14
14
)
15
15
16
- // RepoUnit describes all units of a repository
17
- type RepoUnit struct {
18
- ID int64
19
- RepoID int64 `xorm:"INDEX(s)"`
20
- Type int `xorm:"INDEX(s)"`
21
- Index int
22
- Config map [string ]string `xorm:"JSON"`
23
- CreatedUnix int64 `xorm:"INDEX CREATED"`
24
- Created time.Time `xorm:"-"`
25
- }
26
-
27
16
// Enumerate all the unit types
28
17
const (
29
18
V16UnitTypeCode = iota + 1 // 1 code
@@ -37,14 +26,25 @@ const (
37
26
V16UnitTypeExternalTracker // 9 ExternalTracker
38
27
)
39
28
40
- // Repo describes a repository
41
- type Repo struct {
42
- ID int64
43
- EnableWiki , EnableExternalWiki , EnableIssues , EnableExternalTracker , EnablePulls bool
44
- ExternalWikiURL , ExternalTrackerURL , ExternalTrackerFormat , ExternalTrackerStyle string
45
- }
46
-
47
29
func addUnitsToTables (x * xorm.Engine ) error {
30
+ // RepoUnit describes all units of a repository
31
+ type RepoUnit struct {
32
+ ID int64
33
+ RepoID int64 `xorm:"INDEX(s)"`
34
+ Type int `xorm:"INDEX(s)"`
35
+ Index int
36
+ Config map [string ]string `xorm:"JSON"`
37
+ CreatedUnix int64 `xorm:"INDEX CREATED"`
38
+ Created time.Time `xorm:"-"`
39
+ }
40
+
41
+ // Repo describes a repository
42
+ type Repo struct {
43
+ ID int64
44
+ EnableWiki , EnableExternalWiki , EnableIssues , EnableExternalTracker , EnablePulls bool
45
+ ExternalWikiURL , ExternalTrackerURL , ExternalTrackerFormat , ExternalTrackerStyle string
46
+ }
47
+
48
48
var repos []Repo
49
49
err := x .Table ("repository" ).Select ("*" ).Find (& repos )
50
50
if err != nil {
0 commit comments