From f2d778b5ce454c06a9b6b553370d264e694550fa Mon Sep 17 00:00:00 2001 From: Yuzhiran Dev Date: Sun, 17 May 2026 15:37:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=84=9A=E6=9C=AC=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=E6=97=B6=E7=BC=BA=E5=B0=91init=5Fdb()?= =?UTF-8?q?=EF=BC=8C=E5=AF=BC=E8=87=B4Topic=E8=A1=A8org=5Fid=E5=88=97?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=EF=BC=8C=E5=88=9B=E4=BD=9C=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E7=82=B9=E5=87=BB=E5=90=8E=E7=94=9F=E6=88=90=E6=96=87?= =?UTF-8?q?=E7=AB=A0=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/db_helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/db_helper.py b/scripts/db_helper.py index 35db921..7890b4f 100644 --- a/scripts/db_helper.py +++ b/scripts/db_helper.py @@ -13,10 +13,13 @@ PROJECT_ROOT = Path(__file__).parent.parent sys.path.insert(0, str(PROJECT_ROOT)) sys.path.insert(0, str(PROJECT_ROOT / 'platform' / 'backend')) -from app.database import SessionLocal +from app.database import SessionLocal, init_db from app.models import Topic from sqlalchemy.orm import Session +# 确保数据库 schema 最新(含 org_id 等迁移) +init_db() + def get_topic_by_id(topic_id: str, db: Optional[Session] = None) -> Optional[Dict]: close_db = False if db is None: