创建teacher_model

This commit is contained in:
天天
2026-09-12 14:42:26 +08:00
parent 641af3d126
commit 77ce48310a
+17
View File
@@ -0,0 +1,17 @@
#教师建表语句
from sqlalchemy import Column, String, Integer
from database import Base
class Teacher(Base):
__tablename__ = "ted_info" # 表名
# 字段定义
id = Column(Integer, 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, default=0) # 逻辑删除(软删除),0是未删除,1是删除,默认为0