1
0
Fork 1
Spiegel von https://github.com/dani-garcia/vaultwarden.git synchronisiert 2024-11-30 06:21:11 +01:00
vaultwarden/migrations/mysql/2018-07-11-181453_create_u2f_twofactor/up.sql

16 Zeilen
501 B
MySQL

CREATE TABLE twofactor (
2019-05-27 17:20:20 +02:00
uuid CHAR(36) NOT NULL PRIMARY KEY,
user_uuid CHAR(36) NOT NULL REFERENCES users (uuid),
2019-05-26 23:02:41 +02:00
type INTEGER NOT NULL,
enabled BOOLEAN NOT NULL,
data TEXT NOT NULL,
2019-05-26 23:02:41 +02:00
UNIQUE (user_uuid, type)
);
2019-05-26 23:02:41 +02:00
INSERT INTO twofactor (uuid, user_uuid, type, enabled, data)
2019-05-20 21:12:41 +02:00
SELECT UUID(), uuid, 0, 1, u.totp_secret FROM users u where u.totp_secret IS NOT NULL;
2019-05-20 21:12:41 +02:00
UPDATE users SET totp_secret = NULL; -- Instead of recreating the table, just leave the columns empty