Skip to content

Commit

Permalink
Ignore the migrate if u2f_registration is not exist (go-gitea#18760)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and zeripath committed Feb 14, 2022
1 parent c737708 commit b95bab5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions models/migrations/v209.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ func increaseCredentialIDTo410(x *xorm.Engine) error {
return nil
}

exist, err := x.IsTableExist("u2f_registration")
if err != nil {
return err
}
if !exist {
return nil
}

// Now migrate the old u2f registrations to the new format
type u2fRegistration struct {
ID int64 `xorm:"pk autoincr"`
Expand Down

0 comments on commit b95bab5

Please sign in to comment.