gitea源码

12345678910111213141516171819202122232425262728
  1. // Copyright 2019 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_9
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. func AddUploaderIDForAttachment(x *xorm.Engine) error {
  9. type Attachment struct {
  10. ID int64 `xorm:"pk autoincr"`
  11. UUID string `xorm:"uuid UNIQUE"`
  12. IssueID int64 `xorm:"INDEX"`
  13. ReleaseID int64 `xorm:"INDEX"`
  14. UploaderID int64 `xorm:"INDEX DEFAULT 0"`
  15. CommentID int64
  16. Name string
  17. DownloadCount int64 `xorm:"DEFAULT 0"`
  18. Size int64 `xorm:"DEFAULT 0"`
  19. CreatedUnix timeutil.TimeStamp `xorm:"created"`
  20. }
  21. return x.Sync(new(Attachment))
  22. }