🔨 更新可以直接使用_inst.sh的脚本

This commit is contained in:
shufeng2012 committed 2026-08-12 09:57:55 +08:00
1 parent 8fe2afdfde
commit 4d6e1e1fd4
2 files changed
+40

No files matched your search

+1
View File
@@ -40,6 +40,7 @@ inst_module "db"
inst_module "db2" inst_module "db2"
inst_module "smtp" inst_module "smtp"
inst_module "captcha" inst_module "captcha"
inst_module "captcha2"
inst_module "confs" inst_module "confs"
inst_module "ai_review" # 需联网拉 chromadb onnx 模型(_fetch_onnx_model.sh 走 ModelScope 镜像) inst_module "ai_review" # 需联网拉 chromadb onnx 模型(_fetch_onnx_model.sh 走 ModelScope 镜像)
inst_module "aibox" # 需 ~/.cert/deepseek.key(见 _setenv.sh) inst_module "aibox" # 需 ~/.cert/deepseek.key(见 _setenv.sh)
+39
View File
@@ -0,0 +1,39 @@
-- Users 表创建脚本
-- 数据库类型: SQLite
CREATE TABLE IF NOT EXISTS Users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password_hash TEXT NOT NULL,
create_at DATETIME DEFAULT CURRENT_TIMESTAMP,
last_login DATETIME,
is_active BOOLEAN DEFAULT 1
);
CREATE TABLE IF NOT EXISTS Notes (
id INTEGER PRIMARY KEY AUTOINCREMENT,
pid INTEGER NOT NULL,
owner VARCHAR(128) DEFAULT 'Unknow',
title VARCHAR(128) NOT NULL,
content TEXT NOT NULL
);
-- 旧版增量
-- ALTER TABLE Notes ADD COLUMN owner VARCHAR(128) DEFAULT 'Unknow';
-- ── 日志表(db 内置日志模块)─────────────────────────────────────────
CREATE TABLE IF NOT EXISTS Logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
ts TEXT NOT NULL,
service TEXT NOT NULL,
level TEXT NOT NULL,
message TEXT NOT NULL,
trace_id TEXT,
extra TEXT
);
CREATE INDEX IF NOT EXISTS idx_logs_service_ts ON Logs(service, ts);
CREATE INDEX IF NOT EXISTS idx_logs_level_ts ON Logs(level, ts);
CREATE INDEX IF NOT EXISTS idx_logs_ts ON Logs(ts);
CREATE INDEX IF NOT EXISTS idx_logs_trace ON Logs(trace_id);