code.gitea.io/gitea@v1.21.7/models/migrations/v1_11/v105.go (about)

     1  // Copyright 2019 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package v1_11 //nolint
     5  
     6  import (
     7  	"xorm.io/xorm"
     8  )
     9  
    10  func AddTeamIncludesAllRepositories(x *xorm.Engine) error {
    11  	type Team struct {
    12  		ID                      int64 `xorm:"pk autoincr"`
    13  		IncludesAllRepositories bool  `xorm:"NOT NULL DEFAULT false"`
    14  	}
    15  
    16  	if err := x.Sync(new(Team)); err != nil {
    17  		return err
    18  	}
    19  
    20  	_, err := x.Exec("UPDATE `team` SET `includes_all_repositories` = ? WHERE `name`=?",
    21  		true, "Owners")
    22  	return err
    23  }