ente/server/migrations/80_two_factor_recovery.up.sql

19 lines
706 B
MySQL
Raw Permalink Normal View History

CREATE TABLE IF NOT EXISTS two_factor_recovery (
2024-03-07 12:44:04 +00:00
user_id bigint NOT NULL PRIMARY KEY,
2024-03-05 03:44:39 +00:00
-- 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,
2024-03-06 04:34:03 +00:00
server_passkey_secret_data bytea,
server_passkey_secret_nonce bytea,
user_passkey_secret_data text,
user_passkey_secret_nonce text,
2024-03-05 03:44:39 +00:00
created_at bigint NOT NULL DEFAULT now_utc_micro_seconds(),
updated_at bigint NOT NULL DEFAULT now_utc_micro_seconds()
);
CREATE TRIGGER update_two_factor_recovery_updated_at
2024-03-05 03:44:39 +00:00
BEFORE UPDATE
ON two_factor_recovery
2024-03-05 03:44:39 +00:00
FOR EACH ROW
EXECUTE PROCEDURE
trigger_updated_at_microseconds_column();