This commit is contained in:
dela
2026-01-31 22:53:12 +08:00
commit bc639cf460
30 changed files with 6836 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
-- 系统设置表
CREATE TABLE settings (
key text PRIMARY KEY,
value jsonb NOT NULL,
updated_at timestamptz NOT NULL DEFAULT now()
);
CREATE TRIGGER trg_settings_updated_at
BEFORE UPDATE ON settings
FOR EACH ROW EXECUTE FUNCTION touch_updated_at();
-- 初始化 Telegram 配置
INSERT INTO settings (key, value) VALUES ('telegram', '{
"enabled": false,
"bot_token": "",
"admin_ids": [],
"notify_chat_id": "",
"test_interval_minutes": 60,
"alert_threshold_percent": 50,
"test_url": "https://httpbin.org/ip",
"test_timeout_ms": 5000
}'::jsonb);