ChunkModel
When a document is uploaded, the value of chunk_id needs to be the same as the ID in the vector database.
class ChunkModel(Base):
__tablename__ = "chunks_table"
chunk_id = Column (Integer, primary_key=True, comment="Primary key ID", autoincrement="auto")
document_id = Column (Integer, comment="Document ID")
document_name = Column(String(255), comment="Document name")
chunk_content = Column (TEXT, comment="Text content")
chunk_metadata = Column (JSON, comment="Metadata")
create_time = Column(DateTime(timezone=True), server_default=text("CURRENT_TIMESTAMP"), comment=" Creation time")
__table_args__ = (
Index('ix_document_id', 'document_id'),
Index('ix_create_time', 'create_time')
)
Parent topic: Database Structure