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.

123456789101112131415161718192021222324252627
  1. // Copyright 2022 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_19 //nolint
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. // AddUpdatedUnixToLFSMetaObject adds an updated column to the LFSMetaObject to allow for garbage collection
  9. func AddUpdatedUnixToLFSMetaObject(x *xorm.Engine) error {
  10. // Drop the table introduced in `v211`, it's considered badly designed and doesn't look like to be used.
  11. // See: https://github.com/go-gitea/gitea/issues/21086#issuecomment-1318217453
  12. // LFSMetaObject stores metadata for LFS tracked files.
  13. type LFSMetaObject struct {
  14. ID int64 `xorm:"pk autoincr"`
  15. Oid string `json:"oid" xorm:"UNIQUE(s) INDEX NOT NULL"`
  16. Size int64 `json:"size" xorm:"NOT NULL"`
  17. RepositoryID int64 `xorm:"UNIQUE(s) INDEX NOT NULL"`
  18. CreatedUnix timeutil.TimeStamp `xorm:"created"`
  19. UpdatedUnix timeutil.TimeStamp `xorm:"INDEX updated"`
  20. }
  21. return x.Sync(new(LFSMetaObject))
  22. }