Fix Log model registration - import models before init_db

The Log model was not being registered with SQLAlchemy's metadata,
causing the logs table to not be created on startup.
This commit is contained in:
2026-03-21 12:02:35 +08:00
parent ca69a35e02
commit 204cb223a3
2 changed files with 5 additions and 0 deletions

View File

@@ -2,6 +2,7 @@ from contextlib import asynccontextmanager
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.database import init_db
import app.models # noqa: F401 - 注册所有模型
from app.routers import (
auth_router,
conversation_router,