fix: delete agent 500 error + dynamic personality + deployment guide
- Fix delete agent 500: clean up FK records (agent_llm_logs, permissions, schedules, executions, team_members) and unbind goals/tasks before delete - Remove hardcoded personality templates in Android, replace with dynamic system prompt generation from name + description - Set promptSectionsEnabled=false to bypass PromptComposer for personality - Add Tencent Cloud Linux deployment guide (Docker Compose) - Accumulated backend service updates, frontend UI fixes, Android app changes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""
|
||||
数据源模型
|
||||
"""
|
||||
from sqlalchemy import Column, String, Text, DateTime, JSON, ForeignKey, func
|
||||
from sqlalchemy import Column, String, Text, DateTime, JSON, ForeignKey, Index, func
|
||||
from sqlalchemy.dialects.mysql import CHAR
|
||||
from sqlalchemy.orm import relationship
|
||||
from app.core.database import Base
|
||||
@@ -19,6 +19,7 @@ class DataSource(Base):
|
||||
config = Column(JSON, nullable=False, comment="连接配置(加密存储敏感信息)")
|
||||
status = Column(String(20), default="active", comment="状态: active/inactive/error")
|
||||
user_id = Column(CHAR(36), ForeignKey("users.id"), nullable=False, comment="创建者ID")
|
||||
workspace_id = Column(CHAR(36), ForeignKey("workspaces.id"), nullable=True, comment="所属工作区ID")
|
||||
last_connected_at = Column(DateTime, comment="最后连接时间")
|
||||
created_at = Column(DateTime, default=func.now(), comment="创建时间")
|
||||
updated_at = Column(DateTime, default=func.now(), onupdate=func.now(), comment="更新时间")
|
||||
@@ -26,5 +27,9 @@ class DataSource(Base):
|
||||
# 关系
|
||||
user = relationship("User", backref="data_sources")
|
||||
|
||||
__table_args__ = (
|
||||
Index("ix_data_sources_workspace", "workspace_id"),
|
||||
)
|
||||
|
||||
def __repr__(self):
|
||||
return f"<DataSource(id={self.id}, name={self.name}, type={self.type})>"
|
||||
|
||||
Reference in New Issue
Block a user