feat(agent): add teamId foreign key to agent table and refactor service queries

This commit is contained in:
yiling
2026-05-21 20:41:37 +08:00
parent 6e2ff8a003
commit 2c106bbb77
16 changed files with 498 additions and 71 deletions
+5
View File
@@ -220,6 +220,7 @@ model Team {
providers Provider[] @relation("TeamToProvider")
skills Skill[] @relation("TeamToSkill")
sandbox Sandbox? @relation("TeamToSandbox")
agents Agent[] @relation("TeamToAgent")
@@map("teams")
}
@@ -619,6 +620,10 @@ model Agent {
provider Provider? @relation("ProviderToAgent", fields: [providerId], references: [id], onDelete: SetNull)
modelId String? @map("model_id")
modelRef Model? @relation("ModelToAgent", fields: [modelId], references: [id], onDelete: SetNull)
teamId String @map("team_id")
team Team @relation("TeamToAgent", fields: [teamId], references: [id], onDelete: Cascade)
/// [AgentConfig]
config Json
createdAt DateTime @default(now()) @map("created_at")