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.

v116.go 594B

123456789101112131415161718192021222324252627282930
  1. // Copyright 2019 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 migrations
  5. import (
  6. "code.gitea.io/gitea/models"
  7. "xorm.io/xorm"
  8. )
  9. func extendTrackedTimes(x *xorm.Engine) error {
  10. sess := x.NewSession()
  11. defer sess.Close()
  12. if err := sess.Begin(); err != nil {
  13. return err
  14. }
  15. if _, err := sess.Exec("DELETE FROM tracked_time WHERE time IS NULL"); err != nil {
  16. return err
  17. }
  18. if err := sess.Sync2(new(models.TrackedTime)); err != nil {
  19. return err
  20. }
  21. return sess.Commit()
  22. }