gitea源码

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