19 lines
977 B
Python
19 lines
977 B
Python
from datetime import datetime
|
|
|
|
from sqlalchemy import Column, String, Boolean, TIMESTAMP, func
|
|
from sqlalchemy.dialects.postgresql import BIGINT
|
|
from dataclasses import dataclass
|
|
from database.database import Base
|
|
|
|
@dataclass
|
|
class TTaskQueue(Base):
|
|
__tablename__ = 't_task_queue'
|
|
|
|
id: int = Column(BIGINT, primary_key=True, autoincrement=True, comment='自动递增的唯一任务ID')
|
|
create_time: datetime = Column(TIMESTAMP(timezone=True), server_default=func.now(), nullable=False, comment='任务创建时间')
|
|
task_name: str = Column(String, nullable=True, comment='任务名称')
|
|
module_path: str = Column(String, nullable=True, comment='任务模块路径')
|
|
function_name: str = Column(String, nullable=True, comment='任务函数名称')
|
|
scheduler: str = Column(String, nullable=True, comment='任务执行者名称')
|
|
finished: bool = Column(Boolean, default=False, nullable=False, comment='任务是否执行完成')
|