chore: sync local changes to Gitea
This commit is contained in:
19
migrations/0001_init.sql
Normal file
19
migrations/0001_init.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- Sprout2FA 初始 schema
|
||||
CREATE TABLE IF NOT EXISTS app_meta (
|
||||
key TEXT PRIMARY KEY NOT NULL,
|
||||
value TEXT NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS totp_accounts (
|
||||
id TEXT PRIMARY KEY NOT NULL,
|
||||
label TEXT NOT NULL,
|
||||
issuer TEXT,
|
||||
encrypted_secret TEXT NOT NULL,
|
||||
algorithm TEXT NOT NULL DEFAULT 'SHA1',
|
||||
digits INTEGER NOT NULL DEFAULT 6,
|
||||
period INTEGER NOT NULL DEFAULT 30,
|
||||
created_at INTEGER NOT NULL,
|
||||
sort_order INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_totp_sort ON totp_accounts (sort_order, created_at);
|
||||
4
migrations/0002_share_token.sql
Normal file
4
migrations/0002_share_token.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
-- 临时分享:每个账户可选的唯一 share_token,用于公开链接仅暴露单条 2FA
|
||||
ALTER TABLE totp_accounts ADD COLUMN share_token TEXT;
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS idx_totp_share_token ON totp_accounts (share_token);
|
||||
Reference in New Issue
Block a user