Some checks are pending
CD Pipeline / deploy (push) Waiting to run
技術債清零 (2026-04-19): - migrations/010: ai_insights 補 decay_exempt/avg_quality/status/ai_model/feedback 欄位 - migrations/011: embedding_retry_queue 持久化表 (ADR-009) - migrations/012: backup_log 備份記錄表 - services/openclaw_learning_service: 記憶體 Queue → DB retry queue,時間衰減 RAG - services/nemoton_dispatcher_service: 三個 tool 強制雙寫 ai_insights (_sink_insight_to_km) - services/import_service: Excel 前置欄位防禦(商品名稱類 + 業績金額類) - services/ollama_service: generate_embedding 新增 EMBEDDING_HOST env,embedding 永遠走 192.168.0.111 - SYSTEM_VERSION: V9.4 → V10.3 DB 備份機制: - scripts/pg_backup.sh: host-level pg_dump 備份腳本,cron 每日 02:00,保留 7 天,Telegram 通知 - services/db_backup_service.py: Python 備份 service,寫入 backup_log - scheduler: run_db_backup_task (02:00) + run_backup_monitor_task (每 6h AI Agent 監控) - Dockerfile: 加入 postgresql-client 文件: - CLAUDE.md: 環境架構依 ADR-008 實地重寫,含完整 SSH/Docker 部署 SOP - PROJECT_CONSTITUTION.md: 內容已整合入 CLAUDE.md,刪除重複檔案 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
746 B
SQL
20 lines
746 B
SQL
-- Migration 012: backup_log 備份記錄表
|
|
-- 用於 AI Agent 監控資料庫備份執行狀況
|
|
|
|
CREATE TABLE IF NOT EXISTS backup_log (
|
|
id SERIAL PRIMARY KEY,
|
|
backup_type VARCHAR(20) DEFAULT 'full', -- full / incremental
|
|
filename VARCHAR(255) NOT NULL,
|
|
file_size_bytes BIGINT DEFAULT 0,
|
|
duration_seconds FLOAT DEFAULT 0,
|
|
status VARCHAR(20) DEFAULT 'pending', -- pending / success / failed
|
|
error_message TEXT,
|
|
host VARCHAR(100),
|
|
storage_path VARCHAR(500),
|
|
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
|
|
completed_at TIMESTAMP
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_backup_log_status ON backup_log(status);
|
|
CREATE INDEX IF NOT EXISTS idx_backup_log_created ON backup_log(created_at DESC);
|