gitea源码

123456789101112131415161718
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_23
  4. import "xorm.io/xorm"
  5. func AddBlockAdminMergeOverrideBranchProtection(x *xorm.Engine) error {
  6. type ProtectedBranch struct {
  7. BlockAdminMergeOverride bool `xorm:"NOT NULL DEFAULT false"`
  8. }
  9. _, err := x.SyncWithOptions(xorm.SyncOptions{
  10. IgnoreConstrains: true,
  11. IgnoreIndices: true,
  12. }, new(ProtectedBranch))
  13. return err
  14. }