Fork to maintain patches against the official gitea for https://code.ceondo.com https://github.com/go-gitea/gitea

v34.go 555B

1234567891011121314151617181920212223242526
  1. // Copyright 2017 Gitea. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import (
  6. "github.com/go-xorm/xorm"
  7. )
  8. // Team see models/team.go
  9. type Team struct {
  10. UnitTypes []int `xorm:"json"`
  11. }
  12. const ownerAccessMode = 4
  13. var allUnitTypes = []int{1, 2, 3, 4, 5, 6, 7, 8, 9}
  14. func giveAllUnitsToOwnerTeams(x *xorm.Engine) error {
  15. _, err := x.Cols("unit_types").
  16. Where("authorize = ?", ownerAccessMode).
  17. Update(&Team{UnitTypes: allUnitTypes})
  18. return err
  19. }