gitea源码

v257.go 1.4KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_20
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. func CreateActionArtifactTable(x *xorm.Engine) error {
  9. // ActionArtifact is a file that is stored in the artifact storage.
  10. type ActionArtifact struct {
  11. ID int64 `xorm:"pk autoincr"`
  12. RunID int64 `xorm:"index UNIQUE(runid_name)"` // The run id of the artifact
  13. RunnerID int64
  14. RepoID int64 `xorm:"index"`
  15. OwnerID int64
  16. CommitSHA string
  17. StoragePath string // The path to the artifact in the storage
  18. FileSize int64 // The size of the artifact in bytes
  19. FileCompressedSize int64 // The size of the artifact in bytes after gzip compression
  20. ContentEncoding string // The content encoding of the artifact
  21. ArtifactPath string // The path to the artifact when runner uploads it
  22. ArtifactName string `xorm:"UNIQUE(runid_name)"` // The name of the artifact when runner uploads it
  23. Status int64 `xorm:"index"` // The status of the artifact
  24. CreatedUnix timeutil.TimeStamp `xorm:"created"`
  25. UpdatedUnix timeutil.TimeStamp `xorm:"updated index"`
  26. }
  27. return x.Sync(new(ActionArtifact))
  28. }