This commit is contained in:
admin
2026-02-20 15:47:27 +09:00
parent c60cbf2d9a
commit 584530937b
108 changed files with 12112 additions and 416 deletions

View File

@@ -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):
# ここでは最初のエラーだけ簡潔に返す(必要に応じて整形)