aboutsummaryrefslogtreecommitdiffstats
path: root/models/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'models/migrations')
-rw-r--r--models/migrations/v210.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/models/migrations/v210.go b/models/migrations/v210.go
index dafe355fe2..f32fae77ba 100644
--- a/models/migrations/v210.go
+++ b/models/migrations/v210.go
@@ -174,5 +174,11 @@ func remigrateU2FCredentials(x *xorm.Engine) error {
regs = regs[:0]
}
+ if x.Dialect().URI().DBType == schemas.POSTGRES {
+ if _, err := x.Exec("SELECT setval('webauthn_credential_id_seq', COALESCE((SELECT MAX(id)+1 FROM `webauthn_credential`), 1), false)"); err != nil {
+ return err
+ }
+ }
+
return nil
}