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.

v255.go 526B

1234567891011121314151617181920212223
  1. // Copyright 2023 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_20 //nolint
  4. import (
  5. "code.gitea.io/gitea/modules/timeutil"
  6. "xorm.io/xorm"
  7. )
  8. func AddArchivedUnixToRepository(x *xorm.Engine) error {
  9. type Repository struct {
  10. ArchivedUnix timeutil.TimeStamp `xorm:"DEFAULT 0"`
  11. }
  12. if err := x.Sync(new(Repository)); err != nil {
  13. return err
  14. }
  15. _, err := x.Exec("UPDATE repository SET archived_unix = updated_unix WHERE is_archived = ? AND archived_unix = 0", true)
  16. return err
  17. }