from sqlalchemy import create_engine ,Integer,String,Column
from DBSession import Base


class produce_video_task(Base):
    __tablename__ = 'produce_video_task'
    id = Column(Integer, primary_key=True)
    produce_channel = Column(Integer)
    task_type = Column(Integer)
    project_id = Column(String(32))
    section_id = Column(String(32))
    task_status = Column(Integer)
    job_id = Column(String(32))
    submit_timestamp = Column(Integer)
    submit_result_data = Column(String(32))
    complete_timestamp = Column(Integer)
    duration = Column(Integer)
    error_code = Column(Integer)
    error_msg = Column(String(32))
    create_timestamp = Column(Integer)

    def __init__(self):
        print(self.id)

    def __repr__(self):
        return '<EAVideoIBPInfo %r>' % self.id


class produce_video_project(Base):
    __tablename__ = "produce_video_project"
    project_id = Column(String(64))
    uid = Column(Integer, primary_key=True)
    app_type = Column(Integer)
    platform = Column(String(16))
    title = Column(String(128))
    draftbox_id = Column(String(64))
    article_id = Column(String(64))
    video_width = Column(Integer)
    video_height = Column(Integer)
    oss_object_key = Column(String(255))
    vod_media_id = Column(String(64))
    ice_media_id = Column(String(64))
    video_duration = Column(Integer)
    produce_channel = Column(Integer)
    produce_status = Column(Integer)
    submit_timestamp = Column(Integer)
    produce_done_timestamp = Column(Integer)
    error_code = Column(Integer)
    error_msg = Column(Integer)
    create_timestamp = Column(Integer)
    update_timestamp = Column(Integer)
    video_id = Column(Integer)
    data_status = Column(Integer)
    sdata_version_code = Column(Integer)
    parent_project_id = Column(String(64))
    root_project_id = Column(String(64))
    reproduce_status = Column(Integer)
    from_scene = Column(Integer)



    def __init__(self):
        print(self.uid)

    def __repr__(self):
        return '<EAVideoIBPInfo %r>' % self.uid