新增databases.py把所有建表基类统一成一个,才可以链接外键。

This commit is contained in:
Orangeeee
2026-09-22 15:32:34 +08:00
parent 8f39d5456a
commit e2ccae757c
3 changed files with 10 additions and 8 deletions
+5 -1
View File
@@ -4,15 +4,19 @@ from scores.main import Scores_API
from stu_jiuye.main import Shtudent_Jiuye
from students.main import Students_API
from Teachers.main import Teachers_API
from databases import *
app = FastAPI(title="学生管理系统")
Base_all.metadata.create_all(bind=engine_all)
app.include_router(Classes_API,tags=["classes"])
app.include_router(Scores_API,tags=["scores"])
app.include_router(Shtudent_Jiuye,tags=["Employments"])
app.include_router(Students_API,tags=["students"])
app.include_router(Teachers_API,tags=["teachers"])
def main():
print("Hello from student-manage-system!")