Skip to content

Commit 62ddc5c

Browse files
committed
fix migration
1 parent d1a6ab2 commit 62ddc5c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

models/migrations/v1_23/v310.go

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ import (
88
"xorm.io/xorm"
99
)
1010

11+
type WebAuthnCredential struct {
12+
Flags protocol.AuthenticatorFlags
13+
}
14+
15+
func (cred WebAuthnCredential) TableName() string {
16+
return "webauthn_credential"
17+
}
18+
1119
func AddFlagsOnWebAuthnCredential(x *xorm.Engine) error {
12-
type WebAuthnCredential struct {
13-
Flags protocol.AuthenticatorFlags
14-
}
1520
if err := x.Sync(new(WebAuthnCredential)); err != nil {
1621
return err
1722
}
18-
_, err := x.Exec("UPDATE webauthn_credential SET flags = 29")
23+
_, err := x.Exec("UPDATE webauthn_credential SET flags = 29 WHERE id > 0")
1924
return err
2025
}

0 commit comments

Comments
 (0)