claude_sms_test
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
# model/teacher_model.py
|
||||
# 教师信息表模型
|
||||
from sqlalchemy import Column, String, Integer
|
||||
from sqlalchemy.orm import relationship
|
||||
|
||||
from database import Base
|
||||
|
||||
|
||||
class Teacher(Base):
|
||||
__tablename__ = "tea_info" # 表名
|
||||
|
||||
# 字段定义
|
||||
id = Column(String(15), primary_key=True, index=True) # 主键,索引
|
||||
name = Column(String(20), nullable=False) # 姓名,非空
|
||||
phone = Column(String(20), unique=True, nullable=False) # 电话,唯一,非空
|
||||
type = Column(String(20), nullable=False) # 教师职位,非空
|
||||
is_deleted = Column(Integer, nullable=False, default=0) # 逻辑删除(软删除),0是未删除,1是删除,默认为0
|
||||
|
||||
head_classes = relationship("ClsMgmt",
|
||||
foreign_keys="ClsMgmt.head_tea_id",
|
||||
back_populates="head_teacher")
|
||||
|
||||
lecturer_classes = relationship("ClsMgmt",
|
||||
foreign_keys="ClsMgmt.lecturer_id",
|
||||
back_populates="lecturer")
|
||||
Reference in New Issue
Block a user