gitea源码

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