Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

v99.go 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839
  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/timeutil"
  7. "xorm.io/xorm"
  8. )
  9. func addTaskTable(x *xorm.Engine) error {
  10. // TaskType defines task type
  11. type TaskType int
  12. // TaskStatus defines task status
  13. type TaskStatus int
  14. type Task struct {
  15. ID int64
  16. DoerID int64 `xorm:"index"` // operator
  17. OwnerID int64 `xorm:"index"` // repo owner id, when creating, the repoID maybe zero
  18. RepoID int64 `xorm:"index"`
  19. Type TaskType
  20. Status TaskStatus `xorm:"index"`
  21. StartTime timeutil.TimeStamp
  22. EndTime timeutil.TimeStamp
  23. PayloadContent string `xorm:"TEXT"`
  24. Errors string `xorm:"TEXT"` // if task failed, saved the error reason
  25. Created timeutil.TimeStamp `xorm:"created"`
  26. }
  27. type Repository struct {
  28. Status int `xorm:"NOT NULL DEFAULT 0"`
  29. }
  30. return x.Sync2(new(Task), new(Repository))
  31. }