refactor: 推进后端分层架构治理

This commit is contained in:
jxxghp
2026-08-18 00:29:14 +08:00
parent 5d0bacabd5
commit 5128ae9e1e
363 changed files with 34179 additions and 6019 deletions
+2 -2
View File
@@ -6,6 +6,7 @@ from alembic.config import Config
from app.runtime.config import settings
from app.db import Base
from app.db.models import load_all_models
from app.runtime.log import logger
@@ -19,7 +20,7 @@ def init_db():
from app.db.engine import get_engine
# 确保所有模型都已注册到 Base.metadata 中
import app.db.models # noqa: F401
load_all_models()
# 全量建表
Base.metadata.create_all(bind=get_engine())
@@ -47,4 +48,3 @@ def update_db():
f'数据库更新失败:{str(error)} - {traceback.format_exc()}'
)
raise