27 lines
958 B
Markdown
27 lines
958 B
Markdown
|
|
# Task ID: 120
|
||
|
|
|
||
|
|
**Title:** Add AgentProject junction model
|
||
|
|
|
||
|
|
**Status:** pending
|
||
|
|
|
||
|
|
**Dependencies:** None
|
||
|
|
|
||
|
|
**Priority:** high
|
||
|
|
|
||
|
|
**Description:** Add AgentProject many-to-many junction table linking Agents to Projects with role and optional LLM override
|
||
|
|
|
||
|
|
**Details:**
|
||
|
|
|
||
|
|
In src/db/prisma/schema.prisma add:
|
||
|
|
1. model AgentProject with: id, agentId, projectId, role (@default("developer")), llmId?, createdAt
|
||
|
|
2. Relations: agent (Agent), project (Project), llm (Llm?)
|
||
|
|
3. @@unique([agentId, projectId]), @@index([agentId]), @@index([projectId])
|
||
|
|
4. Add projectMemberships AgentProject[] to Agent model
|
||
|
|
5. Add agentMemberships AgentProject[] to Project model
|
||
|
|
6. Add agentProjects AgentProject[] to Llm model
|
||
|
|
7. Keep Agent.projectId for backward compatibility (one release)
|
||
|
|
|
||
|
|
**Test Strategy:**
|
||
|
|
|
||
|
|
Schema tests: create AgentProject junction, verify unique constraint prevents duplicate membership, test cascade on both Agent and Project delete, test SetNull on Llm delete.
|