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.

v142.go 534B

123456789101112131415161718192021222324
  1. // Copyright 2020 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package v1_13 //nolint
  4. import (
  5. "code.gitea.io/gitea/modules/log"
  6. "xorm.io/builder"
  7. "xorm.io/xorm"
  8. )
  9. func SetIsArchivedToFalse(x *xorm.Engine) error {
  10. type Repository struct {
  11. IsArchived bool `xorm:"INDEX"`
  12. }
  13. count, err := x.Where(builder.IsNull{"is_archived"}).Cols("is_archived").Update(&Repository{
  14. IsArchived: false,
  15. })
  16. if err == nil {
  17. log.Debug("Updated %d repositories with is_archived IS NULL", count)
  18. }
  19. return err
  20. }