gitea源码

v118.go 558B

1234567891011121314151617181920212223242526
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_12
  4. import (
  5. "xorm.io/xorm"
  6. )
  7. func AddReviewCommitAndStale(x *xorm.Engine) error {
  8. type Review struct {
  9. CommitID string `xorm:"VARCHAR(40)"`
  10. Stale bool `xorm:"NOT NULL DEFAULT false"`
  11. }
  12. type ProtectedBranch struct {
  13. DismissStaleApprovals bool `xorm:"NOT NULL DEFAULT false"`
  14. }
  15. // Old reviews will have commit ID set to "" and not stale
  16. if err := x.Sync(new(Review)); err != nil {
  17. return err
  18. }
  19. return x.Sync(new(ProtectedBranch))
  20. }