from sqlalchemy import Column, Integer, Text, BigInteger, String, SmallInteger, Boolean, TIMESTAMP
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()


class AgentTestTask(Base):
    __tablename__ = "agent_test_task"

    id = Column(BigInteger, primary_key=True, autoincrement=True, comment="主键id")
    agent_id = Column(BigInteger, nullable=False, comment="agent主键")
    module_id = Column(BigInteger, nullable=False, comment="model主键")
    create_user = Column(String(32), nullable=True, comment="创建用户")
    update_user = Column(String(32), nullable=True, comment="更新用户")
    dataset_ids = Column(Text, nullable=True, comment="数据集ids")
    status = Column(Integer, nullable=True, comment="状态(0:未开始, 1:进行中, 2:已完成, 3:已取消)")
    create_time = Column(TIMESTAMP, nullable=False, server_default="CURRENT_TIMESTAMP", comment="创建时间")
    update_time = Column(TIMESTAMP, nullable=False, server_default="CURRENT_TIMESTAMP", onupdate="CURRENT_TIMESTAMP",
                         comment="更新时间")