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.

v234.go 1.0KB

12345678910111213141516171819202122232425262728
  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. func CreatePackageCleanupRuleTable(x *xorm.Engine) error {
  9. type PackageCleanupRule struct {
  10. ID int64 `xorm:"pk autoincr"`
  11. Enabled bool `xorm:"INDEX NOT NULL DEFAULT false"`
  12. OwnerID int64 `xorm:"UNIQUE(s) INDEX NOT NULL DEFAULT 0"`
  13. Type string `xorm:"UNIQUE(s) INDEX NOT NULL"`
  14. KeepCount int `xorm:"NOT NULL DEFAULT 0"`
  15. KeepPattern string `xorm:"NOT NULL DEFAULT ''"`
  16. RemoveDays int `xorm:"NOT NULL DEFAULT 0"`
  17. RemovePattern string `xorm:"NOT NULL DEFAULT ''"`
  18. MatchFullName bool `xorm:"NOT NULL DEFAULT false"`
  19. CreatedUnix timeutil.TimeStamp `xorm:"created NOT NULL DEFAULT 0"`
  20. UpdatedUnix timeutil.TimeStamp `xorm:"updated NOT NULL DEFAULT 0"`
  21. }
  22. return x.Sync2(new(PackageCleanupRule))
  23. }