mirror of
https://github.com/ViViDboarder/bitwarden_rs.git
synced 2024-11-05 04:46:36 +00:00
16 lines
510 B
SQL
16 lines
510 B
SQL
CREATE TABLE twofactor (
|
|
uuid VARCHAR(40) NOT NULL PRIMARY KEY,
|
|
user_uuid VARCHAR(40) NOT NULL REFERENCES users (uuid),
|
|
atype INTEGER NOT NULL,
|
|
enabled BOOLEAN NOT NULL,
|
|
data TEXT NOT NULL,
|
|
|
|
UNIQUE (user_uuid, atype)
|
|
);
|
|
|
|
|
|
INSERT INTO twofactor (uuid, user_uuid, atype, enabled, data)
|
|
SELECT UUID(), uuid, 0, 1, u.totp_secret FROM users u where u.totp_secret IS NOT NULL;
|
|
|
|
UPDATE users SET totp_secret = NULL; -- Instead of recreating the table, just leave the columns empty
|