feat(workflow node): The execution records of the tool remove the foreign key that binds to the user, and directly store the user ID.

This commit is contained in:
谢俊男
2026-01-13 14:59:12 +08:00
parent 0a73b18823
commit ab02f610e5
2 changed files with 5 additions and 4 deletions

View File

@@ -211,12 +211,11 @@ class ToolExecution(Base):
token_usage = Column(JSON)
# 用户信息
user_id = Column(UUID(as_uuid=True), ForeignKey("users.id"), index=True)
user_id = Column(UUID(as_uuid=True), index=True, nullable=True)
workspace_id = Column(UUID(as_uuid=True), ForeignKey("workspaces.id"), nullable=False, index=True)
# 关联关系
tool_config = relationship("ToolConfig", back_populates="executions")
user = relationship("User")
workspace = relationship("Workspace")
def __repr__(self):