diff options
author | David Schneiderbauer <daviian@users.noreply.github.com> | 2018-06-21 18:00:13 +0200 |
---|---|---|
committer | techknowlogick <techknowlogick@users.noreply.github.com> | 2018-06-21 12:00:13 -0400 |
commit | 0b3ea428477b9da33f40252e79aafe85b09526f3 (patch) | |
tree | 4fccc7dbf7f027331735d7d041bc290db632b744 /models/migrations/v38.go | |
parent | 46d19c4676efe5201c5de790bcb963bfc93a95c7 (diff) | |
download | gitea-0b3ea428477b9da33f40252e79aafe85b09526f3.tar.gz gitea-0b3ea428477b9da33f40252e79aafe85b09526f3.zip |
hide issues from org private repos w/o team assignment (#4034)
Diffstat (limited to 'models/migrations/v38.go')
-rw-r--r-- | models/migrations/v38.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/models/migrations/v38.go b/models/migrations/v38.go index 6f66484b05..eb90f9fbff 100644 --- a/models/migrations/v38.go +++ b/models/migrations/v38.go @@ -25,10 +25,15 @@ func removeCommitsUnitType(x *xorm.Engine) (err error) { Created time.Time `xorm:"-"` } + type Team struct { + ID int64 + UnitTypes []int `xorm:"json"` + } + // Update team unit types const batchSize = 100 for start := 0; ; start += batchSize { - teams := make([]*models.Team, 0, batchSize) + teams := make([]*Team, 0, batchSize) if err := x.Limit(batchSize, start).Find(&teams); err != nil { return err } @@ -36,7 +41,7 @@ func removeCommitsUnitType(x *xorm.Engine) (err error) { break } for _, team := range teams { - ut := make([]models.UnitType, 0, len(team.UnitTypes)) + ut := make([]int, 0, len(team.UnitTypes)) for _, u := range team.UnitTypes { if u < V16UnitTypeCommits { ut = append(ut, u) |