2026-09-20 14:26:23 +08:00
|
|
|
from sqlalchemy import DATETIME,Column, Integer, String, Date,ForeignKey
|
2026-09-20 15:32:28 +08:00
|
|
|
from datetime import datetime
|
|
|
|
|
from util.database import Base,engine
|
2026-09-20 14:31:52 +08:00
|
|
|
|
|
|
|
|
class Student_Model(Base):
|
2026-09-20 14:26:23 +08:00
|
|
|
__tablename__ = 'wl_student'
|
|
|
|
|
stu_id = Column(Integer
|
|
|
|
|
, primary_key=True
|
|
|
|
|
, autoincrement=True
|
|
|
|
|
,comment='学生编号')
|
2026-09-20 15:32:28 +08:00
|
|
|
# class_id=Column(Integer
|
|
|
|
|
# ,ForeignKey('wl_class.class_id')
|
|
|
|
|
# ,nullable=False
|
|
|
|
|
# ,comment='班级编号')
|
2026-09-20 14:26:23 +08:00
|
|
|
stu_name=Column(String(100),comment='学生姓名')
|
|
|
|
|
age=Column(Integer,comment='年龄')
|
|
|
|
|
gender=Column(String(50),comment='性别')
|
|
|
|
|
native_place=Column(String(200),comment='籍贯')
|
|
|
|
|
birthday=Column(Date,comment='生日')
|
|
|
|
|
school=Column(String(100),comment='毕业学校')
|
|
|
|
|
major=Column(String(50),comment='专业')
|
2026-09-20 14:31:52 +08:00
|
|
|
degree=Column(String(50),comment='学历')
|
2026-09-20 14:26:23 +08:00
|
|
|
admission_date=Column(Date,comment='入学日期')
|
|
|
|
|
graduation_date=Column(Date,comment='毕业日期')
|
2026-09-20 15:32:28 +08:00
|
|
|
progress=Column(Integer,default=0,comment='课程进度:学习中=0,求职中=1,已就业=2')
|
2026-09-20 14:26:23 +08:00
|
|
|
create_date=Column(DATETIME
|
|
|
|
|
,default=datetime.now)
|
|
|
|
|
update_date=Column(DATETIME
|
|
|
|
|
,default=datetime.now
|
|
|
|
|
,onupdate=datetime.now)
|
2026-09-20 14:31:52 +08:00
|
|
|
|
2026-09-20 15:32:28 +08:00
|
|
|
Base.metadata.create_all(engine)
|
2026-09-20 14:31:52 +08:00
|
|
|
|