init
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from sqlalchemy import Column, Integer, String, Text, DateTime, ForeignKey, func
|
||||
from database import Base
|
||||
|
||||
class Document(Base):
|
||||
__tablename__ = "documents"
|
||||
id = Column(Integer, primary_key=True, autoincrement=True)
|
||||
template_id = Column(Integer, ForeignKey("templates.id"), nullable=False)
|
||||
name = Column(String(255), default="", comment="文档名称")
|
||||
para_count_done = Column(Integer, default=0, comment="已完成段落数")
|
||||
para_count_total = Column(Integer, default=0, comment="总段落数")
|
||||
status = Column(String(20), default="pending", comment="pending/generating/completed/failed/cancelled")
|
||||
file_path = Column(String(500), default="", comment="生成的文件路径")
|
||||
error = Column(Text, default="", comment="错误信息")
|
||||
created_at = Column(DateTime, server_default=func.now())
|
||||
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now())
|
||||
Reference in New Issue
Block a user