init
This commit is contained in:
+2
-5
@@ -31,8 +31,5 @@ def get_db():
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
|
||||
def init_db() -> None:
|
||||
"""创建所有表(生产环境建议改用 Alembic 迁移)"""
|
||||
from . import models # noqa: F401 确保模型被导入
|
||||
Base.metadata.create_all(bind=engine)
|
||||
# 注意:本服务不自动建表。
|
||||
# 数据库结构由 docs/schema.sql 手动初始化(与 models.py 保持同步维护)。
|
||||
|
||||
Reference in New Issue
Block a user