You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

v99.go 1.0KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package migrations
  5. import (
  6. "code.gitea.io/gitea/modules/structs"
  7. "code.gitea.io/gitea/modules/timeutil"
  8. "github.com/go-xorm/xorm"
  9. )
  10. func addTaskTable(x *xorm.Engine) error {
  11. type Task struct {
  12. ID int64
  13. DoerID int64 `xorm:"index"` // operator
  14. OwnerID int64 `xorm:"index"` // repo owner id, when creating, the repoID maybe zero
  15. RepoID int64 `xorm:"index"`
  16. Type structs.TaskType
  17. Status structs.TaskStatus `xorm:"index"`
  18. StartTime timeutil.TimeStamp
  19. EndTime timeutil.TimeStamp
  20. PayloadContent string `xorm:"TEXT"`
  21. Errors string `xorm:"TEXT"` // if task failed, saved the error reason
  22. Created timeutil.TimeStamp `xorm:"created"`
  23. }
  24. type Repository struct {
  25. Status int `xorm:"NOT NULL DEFAULT 0"`
  26. }
  27. return x.Sync2(new(Task), new(Repository))
  28. }