Commit d5d4393a authored by etscript's avatar etscript

添加model

parent 0a001e07
# coding: utf-8
from sqlalchemy import Column, DECIMAL, Date, DateTime, ForeignKeyConstraint, Index, LargeBinary, String, TIMESTAMP, Table, Text, text
from sqlalchemy.dialects.mysql import BIGINT, INTEGER, MEDIUMTEXT, SMALLINT, VARCHAR
from sqlalchemy.orm import relationship
from sqlalchemy.ext.declarative import declarative_base
from app.model.base import Base, BaseModel
class CoursePackage(Base, BaseModel):
__tablename__ = 'course_package'
__table_args__ = {'comment': '课程包'}
id = Column(String(64), primary_key=True)
main_title = Column(String(64), nullable=False, comment='主标题')
two_title = Column(String(64), comment='副标题')
type = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='1:普通课程包 2:定期更新系列课程')
course_type = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='1:目录 2:资源')
update_rule = Column(String(64), comment='定期更新更新规则描述')
res_update_time = Column(DateTime, comment='定期资源最后更新时间')
square_img = Column(String(128), nullable=False, comment='方图')
bg_status = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='0:没有 1:有 讲师图')
bg_img = Column(String(128), comment='背景图地址')
length_img = Column(String(128), nullable=False, comment='长图')
progression_status = Column(INTEGER(3), nullable=False, server_default=text("'2'"), comment='发刊词状态 1:有发刊词 2:没有发刊词')
progression_name = Column(String(64), comment='发刊词名称')
progression_id = Column(String(64), comment='发刊词id')
course_sparkle = Column(Text, comment='课程亮点')
course_table = Column(String(128), comment='课程表')
buy_notice = Column(Text, comment='购买须知')
audition_setting = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='试听设置 0:无试听 1:有试听')
audition_type = Column(INTEGER(3), server_default=text("'0'"), comment='试听类型 1:任意选择课程 2:指定课程')
every_select_num = Column(INTEGER(3), server_default=text("'0'"), comment='试听课程数量')
total_num = Column(INTEGER(5), nullable=False, server_default=text("'0'"), comment='总期数')
status = Column(INTEGER(3), nullable=False, server_default=text("'0'"), comment='0:待上架 1:上架 2:下架')
sort = Column(INTEGER(5), nullable=False, server_default=text("'999'"), comment='排序')
stu_pv = Column(INTEGER(8), comment='学习总人次')
stu_uv = Column(INTEGER(8), comment='学习总人数')
create_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP"))
create_by = Column(String(64), nullable=False, server_default=text("'admin'"))
update_time = Column(DateTime, nullable=False, server_default=text("CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"))
update_by = Column(String(64), nullable=False, server_default=text("'admin'"))
delete_tag = Column(INTEGER(3), nullable=False, server_default=text("'0'"))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment