fix(orm): Article 模型加 body_zh_formatted/image_ai_url/4 个 *_status 字段(同步 0002 migration)

This commit is contained in:
Mavis
2026-06-08 16:08:39 +08:00
parent 35c0da1670
commit 4cc5d41e39

View File

@@ -48,6 +48,7 @@ class Article(Base):
title_zh: Mapped[str | None] = mapped_column(Text) title_zh: Mapped[str | None] = mapped_column(Text)
body_zh_html: Mapped[str | None] = mapped_column(Text) body_zh_html: Mapped[str | None] = mapped_column(Text)
body_zh_text: Mapped[str | None] = mapped_column(Text) body_zh_text: Mapped[str | None] = mapped_column(Text)
body_zh_formatted: Mapped[str | None] = mapped_column(Text) # LLM 排版后
summary_zh: Mapped[str | None] = mapped_column(Text) summary_zh: Mapped[str | None] = mapped_column(Text)
# === 翻译状态 === # === 翻译状态 ===
@@ -60,6 +61,23 @@ class Article(Base):
translation_chars: Mapped[int] = mapped_column(Integer, default=0, nullable=False) translation_chars: Mapped[int] = mapped_column(Integer, default=0, nullable=False)
translated_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True)) translated_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True))
# === LLM 增强状态(每个独立状态)===
format_status: Mapped[str] = mapped_column(
String(16), default="n/a", nullable=False
) # pending/ok/failed/n/a
classify_status: Mapped[str] = mapped_column(
String(16), default="n/a", nullable=False
)
image_ai_status: Mapped[str] = mapped_column(
String(16), default="n/a", nullable=False
)
commentary_status: Mapped[str] = mapped_column(
String(16), default="n/a", nullable=False
)
# === LLM 增强内容 ===
image_ai_url: Mapped[str | None] = mapped_column(Text) # AI 生成的插图
# === ML 字段(预留,MVP 全 null)=== # === ML 字段(预留,MVP 全 null)===
category: Mapped[str | None] = mapped_column(String(32), index=True) category: Mapped[str | None] = mapped_column(String(32), index=True)
commentary: Mapped[str | None] = mapped_column(Text) commentary: Mapped[str | None] = mapped_column(Text)