-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #49 from sebadob/webauthn-cred-id-migration
Webauthn cred id migration
- Loading branch information
Showing
24 changed files
with
271 additions
and
118 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,31 @@ | ||
alter table users | ||
add webauthn_enabled bool default false not null; | ||
add webauthn_user_id varchar; | ||
|
||
alter table users | ||
add constraint users_pk2 | ||
unique (webauthn_user_id); | ||
|
||
-- This index was a duplicate -> there is one anyway from the 2nd PK on email | ||
drop index users_email_uindex; | ||
|
||
create table passkeys | ||
( | ||
user_id varchar not null | ||
user_id varchar not null | ||
constraint passkeys_users_id_fk | ||
references users | ||
on update cascade on delete cascade, | ||
name varchar not null, | ||
passkey varchar not null, | ||
registered bigint not null, | ||
last_used bigint not null, | ||
name varchar not null, | ||
passkey_user_id varchar not null | ||
constraint passkeys_users_webauthn_user_id_fk | ||
references users (webauthn_user_id) | ||
on update cascade on delete cascade, | ||
passkey varchar not null, | ||
credential_id bytea not null, | ||
registered bigint not null, | ||
last_used bigint not null, | ||
constraint passkeys_pk | ||
primary key (user_id, name) | ||
); | ||
|
||
create index passkeys_credential_id_index | ||
on passkeys (credential_id); |
Oops, something went wrong.