DocumentModel类
class DocumentModel(Base): __tablename__ = "document_table" document_id = Column(Integer, primary_key=True, autoincrement=True) knowledge_id = Column(Integer, comment="知识库ID", nullable=False) knowledge_name = Column(String, comment="知识库名称") document_name = Column(String, comment="文档名称") document_file_path = Column(String, comment="文档路径") create_time = Column(DateTime, comment="创建时间", default=datetime.datetime.utcnow) __table_args__ = ( UniqueConstraint('knowledge_id', 'document_name', name="knowledge_id"), {"sqlite_autoincrement": True} )
父主题: 数据库结构