refactor: migrate SegmentAttachmentBinding to TypeBase (#34810)

This commit is contained in:
sxxtony
2026-04-13 05:22:43 +00:00
committed by GitHub
parent 3b9aad2ba7
commit 7dd507af04
3 changed files with 32 additions and 4 deletions
+7 -3
View File
@@ -1688,7 +1688,7 @@ class PipelineRecommendedPlugin(TypeBase):
)
class SegmentAttachmentBinding(Base):
class SegmentAttachmentBinding(TypeBase):
__tablename__ = "segment_attachment_bindings"
__table_args__ = (
sa.PrimaryKeyConstraint("id", name="segment_attachment_binding_pkey"),
@@ -1701,13 +1701,17 @@ class SegmentAttachmentBinding(Base):
),
sa.Index("segment_attachment_binding_attachment_idx", "attachment_id"),
)
id: Mapped[str] = mapped_column(StringUUID, default=lambda: str(uuidv7()))
id: Mapped[str] = mapped_column(
StringUUID, insert_default=lambda: str(uuidv7()), default_factory=lambda: str(uuidv7()), init=False
)
tenant_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
dataset_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
document_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
segment_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
attachment_id: Mapped[str] = mapped_column(StringUUID, nullable=False)
created_at: Mapped[datetime] = mapped_column(sa.DateTime, nullable=False, server_default=func.current_timestamp())
created_at: Mapped[datetime] = mapped_column(
sa.DateTime, nullable=False, server_default=func.current_timestamp(), init=False
)
class DocumentSegmentSummary(Base):