fix local db initialization model registration

This commit is contained in:
jxxghp
2026-04-16 17:05:57 +08:00
parent 49b50e5975
commit 60996be71b
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -10,6 +10,9 @@ def init_db():
"""
初始化数据库
"""
# 确保所有模型都已注册到 Base.metadata 中
import app.db.models # noqa: F401
# 全量建表
Base.metadata.create_all(bind=Engine) # noqa