增加了num的唯一键,修改了dao和api

This commit is contained in:
2026-09-22 19:33:36 +08:00
parent 28e0401383
commit 5881afd5cc
6 changed files with 98 additions and 120 deletions
@@ -14,6 +14,7 @@ class ClassInfo(Base):
)
num = Column(String(50)
,nullable=False
,unique=True
,comment='班级编号'
)
name = Column(String(50)
@@ -21,26 +22,18 @@ class ClassInfo(Base):
,comment='班级名称'
)
head_teacher_id = Column(Integer
# ,ForeignKey('teacher.id')
,ForeignKey('teacher.id')
,comment='班主任编号'
)
coach_teacher_id = Column(Integer
# ,ForeignKey('teacher.id')
,ForeignKey('teacher.id')
,comment='授课老师编号'
)
tutor_teacher_id = Column(Integer
# ,ForeignKey('teacher.id')
,ForeignKey('teacher.id')
,comment='助教老师编号'
)
# class_teacher = Column(String(50)
# ,nullable=False
# ,comment='班主任'
# )
# class_lecturer = Column(String(50)
# ,nullable=False
# ,comment='授课老师'
# )
class_start_time = Column(Date
,comment='开班日期'
)