diff --git a/backend/package/yuxi/storage/postgres/models_business.py b/backend/package/yuxi/storage/postgres/models_business.py index 179e4708..f1a5fde8 100644 --- a/backend/package/yuxi/storage/postgres/models_business.py +++ b/backend/package/yuxi/storage/postgres/models_business.py @@ -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, diff --git a/backend/package/yuxi/storage/postgres/models_channels.py b/backend/package/yuxi/storage/postgres/models_channels.py index 84d7888e..5f65b326 100644 --- a/backend/package/yuxi/storage/postgres/models_channels.py +++ b/backend/package/yuxi/storage/postgres/models_channels.py @@ -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(