gitea源码

v302.go 516B

12345678910111213141516171819202122
  1. // Copyright 2024 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_23
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. func AddIndexToActionTaskStoppedLogExpired(x *xorm.Engine) error {
  9. type ActionTask struct {
  10. Stopped timeutil.TimeStamp `xorm:"index(stopped_log_expired)"`
  11. LogExpired bool `xorm:"index(stopped_log_expired)"`
  12. }
  13. _, err := x.SyncWithOptions(xorm.SyncOptions{
  14. IgnoreDropIndices: true,
  15. }, new(ActionTask))
  16. return err
  17. }