Some checks failed
CD Pipeline / deploy (push) Failing after 59s
- 建立 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>
26 lines
709 B
Python
26 lines
709 B
Python
import sys
|
|
import os
|
|
|
|
# 加入專案路徑
|
|
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__))))
|
|
|
|
from database.manager import DatabaseManager
|
|
from database.models import Base, MonthlySummaryAnalysis
|
|
|
|
def migrate():
|
|
print("Starting database migration for MonthlySummaryAnalysis...")
|
|
try:
|
|
db = DatabaseManager()
|
|
engine = db.engine
|
|
|
|
# 建立所有尚未存在的資料表 (包含 MonthlySummaryAnalysis)
|
|
Base.metadata.create_all(engine)
|
|
|
|
print("✓ Database migration completed successfully.")
|
|
except Exception as e:
|
|
print(f"✗ Migration failed: {e}")
|
|
sys.exit(1)
|
|
|
|
if __name__ == "__main__":
|
|
migrate()
|