Files
ewoooc/migrations/008_ai_insights.sql
ogt 1b4f3a7bbe
Some checks failed
CD Pipeline / deploy (push) Failing after 59s
feat: EwoooC 初始化 — 完整專案推版至 Gitea
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml)
- 部署模式: rsync Python 檔案至 188 → docker restart (volume mount)
- Dockerfile/requirements 變動時自動重建 Docker image
- 部署通知: Telegram (開始/成功/失敗)
- 健康檢查: https://mo.wooo.work/health (最多 5 次重試)
- 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-19 01:21:13 +08:00

21 lines
764 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- ADR-007AI_insights DB 實體表建立
-- 日期: 2026-04-18
CREATE TABLE IF NOT EXISTS ai_insights (
id SERIAL PRIMARY KEY,
insight_type VARCHAR(50) NOT NULL,
period VARCHAR(50),
product_sku VARCHAR(50),
content TEXT NOT NULL,
metadata_json TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_ai_insights_type ON ai_insights(insight_type);
CREATE INDEX IF NOT EXISTS idx_ai_insights_period ON ai_insights(period);
CREATE INDEX IF NOT EXISTS idx_ai_insights_sku ON ai_insights(product_sku);
CREATE INDEX IF NOT EXISTS idx_ai_insights_created ON ai_insights(created_at);
-- 注意Step 3 才會在此表加上 embedding vector(1024) 欄位