细节优化

This commit is contained in:
amb
2026-09-02 18:32:56 +08:00
parent 8ec7856bfc
commit bfb7a1a8a2
7 changed files with 69 additions and 53 deletions
+5
View File
@@ -126,6 +126,11 @@ class Document(UUIDPrimaryKeyMixin, TimestampMixin, Base):
nullable=False,
comment="状态 (PENDING/PROCESSING/READY/FAILED/DELETED)",
)
deleted_at: Mapped[str | None] = mapped_column(
String(32),
nullable=True,
comment="进入回收站时间(NULL=未删除),3 天后自动清理",
)
error_code: Mapped[str | None] = mapped_column(
String(64),
nullable=True,
+5
View File
@@ -52,6 +52,11 @@ class DocumentCategory(UUIDPrimaryKeyMixin, TimestampMixin, Base):
nullable=False,
comment="排序序号",
)
deleted_at: Mapped[str | None] = mapped_column(
String(32),
nullable=True,
comment="进入回收站时间(NULL=未删除),3 天后自动清理",
)
# 关系
knowledge_base = relationship("KnowledgeBase", back_populates="categories", lazy="selectin")
+5
View File
@@ -65,6 +65,11 @@ class KnowledgeBase(UUIDPrimaryKeyMixin, TimestampMixin, Base):
nullable=True,
comment="链接过期时间,NULL=长期有效",
)
deleted_at: Mapped[str | None] = mapped_column(
String(32),
nullable=True,
comment="进入回收站时间(NULL=未删除),3 天后自动清理",
)
# 关系
user = relationship("User", back_populates="knowledge_bases", lazy="selectin")