Add table for account recovery
This commit is contained in:
parent
d7854fa6c0
commit
23fcce245d
2 changed files with 20 additions and 0 deletions
2
server/migrations/80_account_recovery.down.sql
Normal file
2
server/migrations/80_account_recovery.down.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
DROP TABLE IF NOT EXISTS account_recovery;
|
||||
DROP TRIGGER IF EXISTS update_account_recovery_updated_at ON account_recovery;
|
18
server/migrations/80_account_recovery.up.sql
Normal file
18
server/migrations/80_account_recovery.up.sql
Normal file
|
@ -0,0 +1,18 @@
|
|||
CREATE TABLE IF NOT EXISTS account_recovery (
|
||||
user_id bigint NOT NULL,
|
||||
-- if false, the support team team will not be able to reset the MFA for the user
|
||||
enable_admin_mfa_reset boolean NOT NULL DEFAULT true,
|
||||
pass_key_reset_key uuid,
|
||||
pass_key_reset_enc_data jsonb,
|
||||
twofa_key_reset_key uuid,
|
||||
twofa_key_reset_enc_data jsonb,
|
||||
created_at bigint NOT NULL DEFAULT now_utc_micro_seconds(),
|
||||
updated_at bigint NOT NULL DEFAULT now_utc_micro_seconds()
|
||||
);
|
||||
|
||||
CREATE TRIGGER update_account_recovery_updated_at
|
||||
BEFORE UPDATE
|
||||
ON account_recovery
|
||||
FOR EACH ROW
|
||||
EXECUTE PROCEDURE
|
||||
trigger_updated_at_microseconds_column();
|
Loading…
Add table
Reference in a new issue