This commit is contained in:
nora 2025-07-13 01:04:41 +02:00
parent 0f46ff5a89
commit c789f7ad15
10 changed files with 406 additions and 9 deletions

View file

@ -0,0 +1,19 @@
CREATE TABLE IF NOT EXISTS used_totp (
user_id INTEGER,
code TEXT,
PRIMARY KEY (user_id, code),
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
) STRICT;
CREATE TABLE IF NOT EXISTS totp_devices (
id INTEGER PRIMARY KEY,
user_id INTEGER NOT NULL,
secret TEXT NOT NULL,
created_time INTEGER NOT NULL,
name TEXT NOT NULL,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
) STRICT;
CREATE INDEX totp_devices_user_id ON totp_devices(user_id);