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.1KB

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