refactor(postgres models): 调整多个数据库字段长度和注释
1. 将ChannelContentReviewRecord的account_id从String(64)扩容至String(128),补充注释说明对齐channel_accounts.account_id 2. 将Conversation的uid从String(64)扩容至String(225),补充注释说明包含服务账号uid 3. 将Conversation的channel_account_id从String(64)扩容至String(128),补充对齐注释 4. 将MessageFeedback和AgentRun的uid从String(64)扩容至String(225),补充注释说明包含服务账号uid
This commit is contained in:
parent
b10cb080de
commit
111f510cf5
@ -264,7 +264,7 @@ class Conversation(Base):
|
||||
|
||||
id = Column(Integer, primary_key=True, autoincrement=True, comment="Primary key")
|
||||
thread_id = Column(String(64), unique=True, index=True, nullable=False, comment="Thread ID (UUID)")
|
||||
uid = Column(String(64), index=True, nullable=False, comment="UID")
|
||||
uid = Column(String(225), index=True, nullable=False, comment="UID(含服务账号 uid,最长 225 字符)")
|
||||
agent_id = Column(String(64), index=True, nullable=False, comment="Agent ID")
|
||||
title = Column(String(255), nullable=True, comment="Conversation title")
|
||||
status = Column(String(20), default="active", comment="Status: active/archived/deleted")
|
||||
@ -283,7 +283,9 @@ class Conversation(Base):
|
||||
)
|
||||
channel_session_id = Column(String(64), nullable=True, comment="关联渠道会话 ID(冗余,便于查询)")
|
||||
channel_type = Column(String(32), nullable=True, index=True, comment="来源渠道类型(FR-10)")
|
||||
channel_account_id = Column(String(64), nullable=True, comment="来源渠道账户 ID(FR-10)")
|
||||
channel_account_id = Column(
|
||||
String(128), nullable=True, comment="来源渠道账户 ID(FR-10,对齐 channel_accounts.account_id)"
|
||||
)
|
||||
|
||||
# Relationships
|
||||
messages = relationship("Message", back_populates="conversation", cascade="all, delete-orphan")
|
||||
@ -487,7 +489,7 @@ class MessageFeedback(Base):
|
||||
message_id = Column(
|
||||
Integer, ForeignKey("messages.id"), nullable=False, index=True, comment="Message ID being rated"
|
||||
)
|
||||
uid = Column(String(64), nullable=False, index=True, comment="UID who provided feedback")
|
||||
uid = Column(String(225), nullable=False, index=True, comment="UID who provided feedback(含服务账号 uid)")
|
||||
rating = Column(String(10), nullable=False, comment="Feedback rating: like or dislike")
|
||||
reason = Column(Text, nullable=True, comment="Optional reason for dislike feedback")
|
||||
created_at = Column(DateTime, default=utc_now_naive, comment="Feedback creation time")
|
||||
@ -769,7 +771,7 @@ class AgentRun(Base):
|
||||
id = Column(String(64), primary_key=True, comment="Run ID (UUID)")
|
||||
thread_id = Column(String(64), index=True, nullable=False, comment="Thread ID")
|
||||
agent_id = Column(String(64), index=True, nullable=False, comment="Agent ID")
|
||||
uid = Column(String(64), index=True, nullable=False, comment="UID")
|
||||
uid = Column(String(225), index=True, nullable=False, comment="UID(含服务账号 uid,最长 225 字符)")
|
||||
status = Column(
|
||||
String(32),
|
||||
index=True,
|
||||
|
||||
@ -867,7 +867,9 @@ class ChannelContentReviewRecord(Base):
|
||||
|
||||
# 关联上下文
|
||||
channel_type = Column(String(32), nullable=False, index=True, comment="渠道类型(feishu / wechat / ...)")
|
||||
account_id = Column(String(64), nullable=False, index=True, comment="渠道账户 ID")
|
||||
account_id = Column(
|
||||
String(128), nullable=False, index=True, comment="渠道账户 ID(对齐 channel_accounts.account_id)"
|
||||
)
|
||||
|
||||
# 审核入参
|
||||
resource_type = Column(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user