修正
This commit is contained in:
@@ -21,6 +21,18 @@ app.add_middleware(
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# ─────────────────────────
|
||||
# 自動データベース遷移
|
||||
# ─────────────────────────
|
||||
@app.on_event("startup")
|
||||
async def run_startup_migration():
|
||||
"""アプリケーション起動時にデータベス遷移を実行"""
|
||||
try:
|
||||
from app.db_auto_migration import run_auto_migration
|
||||
run_auto_migration()
|
||||
except Exception as e:
|
||||
print(f"⚠️ 遷移エラー(無視): {e}")
|
||||
|
||||
@app.exception_handler(ValidationError)
|
||||
async def validation_exception_handler(request: Request, exc: ValidationError):
|
||||
# ここでは最初のエラーだけ簡潔に返す(必要に応じて整形)
|
||||
|
||||
Reference in New Issue
Block a user