refactor: unify 4 isolated SQLAlchemy Base instances to database.models.Base

- database/import_models.py: 移除 ext.declarative.declarative_base,改用 from database.models import Base
- database/notification_models.py: 同上
- database/ppt_reports.py: 移除 orm.declarative_base,改用共用 Base
- database/vendor_models.py: 同上
- database/manager.py: 加入 4 個模型的 noqa import,確保 Base.metadata 完整管理所有資料表

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ogt
2026-04-27 21:27:20 +08:00
parent b0fbd063c8
commit e611702bb9
5 changed files with 9 additions and 12 deletions

View File

@@ -9,6 +9,10 @@ from .edm_models import PromoProduct # V-Fix: 確保 EDM 模型被註冊,以
from .trend_models import TrendRecord, TrendKeyword, TrendAnalysis, WebSearchCache, TelegramUser # noqa: F401 - 趨勢資料表
from .ai_models import AgentContext, ActionPlan, ActionOutcome, AgentStrategyWeights # noqa: F401 - AI agent 模型
from .autoheal_models import Incident, Playbook, HealLog # noqa: F401 - ADR-013 AIOps 自動修復表
from .import_models import ImportJob # noqa: F401 - 確保 import_jobs 表被 Base.metadata 管理
from .notification_models import NotificationTemplate # noqa: F401 - 確保 notification_templates 表被 Base.metadata 管理
from .ppt_reports import PPTReport # noqa: F401 - 確保 ppt_reports 表被 Base.metadata 管理
from .vendor_models import VendorStockout # noqa: F401 - 確保 vendor_stockout 表被 Base.metadata 管理
# 🚩 導入優化後的日誌管理模組
from services.logger_manager import SystemLogger