refactor(backend): change prompt field type from varchar(8192) to text

Update the 'prompt' field in the Assistant model to use a Text type for improved flexibility. This change is accompanied by a migration script to alter the database schema accordingly.
This commit is contained in:
Xin Wang
2026-08-07 11:30:58 +08:00
parent a9d54e7c2b
commit 39ee5ef96e
2 changed files with 41 additions and 1 deletions

View File

@@ -171,7 +171,7 @@ class Assistant(Base):
)
# ---- 瘦类型专属字段(真列,稀疏:按 type 用其中几列) ----
prompt: Mapped[str] = mapped_column(String(8192), default="") # prompt / opencode
prompt: Mapped[str] = mapped_column(Text, default="") # prompt / opencode
dynamic_variable_definitions: Mapped[dict] = mapped_column(JSON, default=dict)
analysis_config: Mapped[dict] = mapped_column(JSONB, default=dict)
api_url: Mapped[str] = mapped_column(String(512), default="") # dify / fastgpt / opencode