Files
2026-09-22 22:32:44 +08:00

59 lines
1.9 KiB
Python

from databases import engine_all,Base_all,Session
from datetime import datetime
from sqlalchemy import *
import enum
class Gender(str,enum.Enum):
m = '男'
f = '女'
h = '未知'
class Tea(Base_all):
__tablename__ = 'teachers'
id = Column(Integer
, primary_key=True
,nullable=False
,autoincrement=True
,comment='id')
name = Column(String(50)
,comment='姓名')
sex = Column(Enum(Gender),default='未知'
,comment='性别')
class_id = Column(Integer
,comment='班级id')
phone = Column(String(50))
subject_id = Column(Integer
, ForeignKey('subject.id')
,comment='教学科目')
home_place = Column(String(50)
,comment='家乡')
specialty = Column(String(50)
,comment='专业')
start_time = Column(DateTime,comment='入职时间')
work_experience = Column(String(50)
,comment='工作经验')
education = Column(String(50)
,comment='学历')
collage = Column(String(50)
,comment='毕业院校')
create_date = Column(DateTime
,default=datetime.now
,comment='创建时间')
update_date = Column(DateTime
,onupdate=datetime.now
,comment='更新时间')
is_delete = Column(Boolean,default=False,comment='是否删除')
delete_time = Column(DateTime)
#科目表
class Sub(Base_all):
__tablename__ = 'subject'
id = Column(Integer
, primary_key=True
, nullable=False
, autoincrement=True
, comment='id')
name = Column(String(50)
,nullable=False
,comment='科目名字')