diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2022-02-14 16:13:17 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-14 08:13:17 +0000 |
commit | 581a563cac5e910510f4f5cc54ccb4478193846f (patch) | |
tree | cd0c04a4f71ed28c962402e85adb37006e151e34 /models | |
parent | 27af864cc29871d32f900d49f8c05c452f7019c2 (diff) | |
download | gitea-581a563cac5e910510f4f5cc54ccb4478193846f.tar.gz gitea-581a563cac5e910510f4f5cc54ccb4478193846f.zip |
Ignore the migrate if u2f_registration is not exist (#18760)
Diffstat (limited to 'models')
-rw-r--r-- | models/migrations/v209.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/models/migrations/v209.go b/models/migrations/v209.go index c42aba245b..b4295d62fa 100644 --- a/models/migrations/v209.go +++ b/models/migrations/v209.go @@ -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"` |