Skip to content

Migration fixes 5318 1.6 backport #5355

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion models/migrations/v64.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func addMultipleAssignees(x *xorm.Engine) error {
IsClosed bool `xorm:"INDEX"`
IsPull bool `xorm:"INDEX"` // Indicates whether is a pull request or not.
NumComments int
Ref string

DeadlineUnix util.TimeStamp `xorm:"INDEX"`
CreatedUnix util.TimeStamp `xorm:"INDEX created"`
Expand Down
9 changes: 9 additions & 0 deletions models/migrations/v67.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
package migrations

import (
"fmt"

"code.gitea.io/gitea/modules/setting"

"github.com/go-xorm/xorm"
Expand Down Expand Up @@ -70,6 +72,13 @@ func removeStaleWatches(x *xorm.Engine) error {
return err
}

var issueWatch IssueWatch
if exist, err := sess.IsTableExist(&issueWatch); err != nil {
return fmt.Errorf("IsExist IssueWatch: %v", err)
} else if !exist {
return nil
}

repoCache := make(map[int64]*Repository)
err := x.BufferSize(setting.IterateBufferSize).Iterate(new(Watch),
func(idx int, bean interface{}) error {
Expand Down