gitea源码

v94.go 593B

123456789101112131415161718192021222324
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_10
  4. import "xorm.io/xorm"
  5. func AddStatusCheckColumnsForProtectedBranches(x *xorm.Engine) error {
  6. type ProtectedBranch struct {
  7. EnableStatusCheck bool `xorm:"NOT NULL DEFAULT false"`
  8. StatusCheckContexts []string `xorm:"JSON TEXT"`
  9. }
  10. if err := x.Sync(new(ProtectedBranch)); err != nil {
  11. return err
  12. }
  13. _, err := x.Cols("enable_status_check", "status_check_contexts").Update(&ProtectedBranch{
  14. EnableStatusCheck: false,
  15. StatusCheckContexts: []string{},
  16. })
  17. return err
  18. }