gitea源码

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_21
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. func AddActionScheduleTable(x *xorm.Engine) error {
  9. type ActionSchedule struct {
  10. ID int64
  11. Title string
  12. Specs []string
  13. RepoID int64 `xorm:"index"`
  14. OwnerID int64 `xorm:"index"`
  15. WorkflowID string
  16. TriggerUserID int64
  17. Ref string
  18. CommitSHA string
  19. Event string
  20. EventPayload string `xorm:"LONGTEXT"`
  21. Content []byte
  22. Created timeutil.TimeStamp `xorm:"created"`
  23. Updated timeutil.TimeStamp `xorm:"updated"`
  24. }
  25. type ActionScheduleSpec struct {
  26. ID int64
  27. RepoID int64 `xorm:"index"`
  28. ScheduleID int64 `xorm:"index"`
  29. Spec string
  30. Next timeutil.TimeStamp `xorm:"index"`
  31. Prev timeutil.TimeStamp
  32. Created timeutil.TimeStamp `xorm:"created"`
  33. Updated timeutil.TimeStamp `xorm:"updated"`
  34. }
  35. return x.Sync(
  36. new(ActionSchedule),
  37. new(ActionScheduleSpec),
  38. )
  39. }