chore: sync local changes to Gitea

This commit is contained in:
shumengya
2026-06-24 22:10:27 +08:00
commit 0812a531e2
44 changed files with 11212 additions and 0 deletions

19
migrations/0001_init.sql Normal file
View 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);

View 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);