13 lines
640 B
Python
13 lines
640 B
Python
from database import DATETIME, Base, Column, Integer, String
|
|
from datetime import datetime
|
|
|
|
|
|
class Course(Base):
|
|
__tablename__ = 'student_course'
|
|
|
|
course_id = Column(String(20), primary_key=True, comment='课程编号')
|
|
course_name = Column(String(50), nullable=False, comment='课程名称')
|
|
teacher_id = Column(String(20), nullable=True, comment='授课教师编号')
|
|
is_deleted = Column(Integer, nullable=False, default=0, comment='0未删1已删')
|
|
create_time = Column(DATETIME, default=datetime.now, nullable=False)
|
|
update_time = Column(DATETIME, default=datetime.now, onupdate=datetime.now, nullable=False) |