|
datasource db { |
|
provider = "sqlite" |
|
url = "file:./dev.db" |
|
} |
|
|
|
generator client { |
|
provider = "prisma-client-py" |
|
recursive_type_depth = 5 |
|
interface = "asyncio" |
|
} |
|
|
|
|
|
model User { |
|
id String @id |
|
email String @unique |
|
name String? |
|
createdAt DateTime @default(now()) |
|
updatedAt DateTime @updatedAt |
|
|
|
|
|
AgentGraphs AgentGraph[] |
|
AgentGraphExecutions AgentGraphExecution[] |
|
AgentGraphExecutionSchedules AgentGraphExecutionSchedule[] |
|
|
|
@@index([id]) |
|
@@index([email]) |
|
} |
|
|
|
|
|
model AgentGraph { |
|
id String @default(uuid()) |
|
version Int @default(1) |
|
|
|
name String? |
|
description String? |
|
isActive Boolean @default(true) |
|
isTemplate Boolean @default(false) |
|
|
|
|
|
userId String |
|
user User @relation(fields: [userId], references: [id]) |
|
|
|
AgentNodes AgentNode[] |
|
AgentGraphExecution AgentGraphExecution[] |
|
AgentGraphExecutionSchedule AgentGraphExecutionSchedule[] |
|
|
|
|
|
AgentSubGraphs AgentGraph[] @relation("AgentSubGraph") |
|
agentGraphParentId String? |
|
AgentGraphParent AgentGraph? @relation("AgentSubGraph", fields: [agentGraphParentId, version], references: [id, version]) |
|
|
|
@@id(name: "graphVersionId", [id, version]) |
|
} |
|
|
|
|
|
model AgentNode { |
|
id String @id @default(uuid()) |
|
|
|
agentBlockId String |
|
AgentBlock AgentBlock @relation(fields: [agentBlockId], references: [id]) |
|
|
|
agentGraphId String |
|
agentGraphVersion Int @default(1) |
|
AgentGraph AgentGraph @relation(fields: [agentGraphId, agentGraphVersion], references: [id, version]) |
|
|
|
|
|
Input AgentNodeLink[] @relation("AgentNodeSink") |
|
|
|
|
|
Output AgentNodeLink[] @relation("AgentNodeSource") |
|
|
|
|
|
constantInput String @default("{}") |
|
|
|
|
|
metadata String @default("{}") |
|
|
|
ExecutionHistory AgentNodeExecution[] |
|
} |
|
|
|
|
|
model AgentNodeLink { |
|
id String @id @default(uuid()) |
|
|
|
|
|
agentNodeSourceId String |
|
AgentNodeSource AgentNode @relation("AgentNodeSource", fields: [agentNodeSourceId], references: [id]) |
|
sourceName String |
|
|
|
|
|
agentNodeSinkId String |
|
AgentNodeSink AgentNode @relation("AgentNodeSink", fields: [agentNodeSinkId], references: [id]) |
|
sinkName String |
|
|
|
|
|
isStatic Boolean @default(false) |
|
} |
|
|
|
|
|
model AgentBlock { |
|
id String @id @default(uuid()) |
|
name String @unique |
|
|
|
|
|
|
|
inputSchema String |
|
outputSchema String |
|
|
|
|
|
ReferencedByAgentNode AgentNode[] |
|
} |
|
|
|
|
|
model AgentGraphExecution { |
|
id String @id @default(uuid()) |
|
|
|
agentGraphId String |
|
agentGraphVersion Int @default(1) |
|
AgentGraph AgentGraph @relation(fields: [agentGraphId, agentGraphVersion], references: [id, version]) |
|
|
|
AgentNodeExecutions AgentNodeExecution[] |
|
|
|
|
|
userId String |
|
user User @relation(fields: [userId], references: [id]) |
|
} |
|
|
|
|
|
model AgentNodeExecution { |
|
id String @id @default(uuid()) |
|
|
|
agentGraphExecutionId String |
|
AgentGraphExecution AgentGraphExecution @relation(fields: [agentGraphExecutionId], references: [id]) |
|
|
|
agentNodeId String |
|
AgentNode AgentNode @relation(fields: [agentNodeId], references: [id]) |
|
|
|
Input AgentNodeExecutionInputOutput[] @relation("AgentNodeExecutionInput") |
|
Output AgentNodeExecutionInputOutput[] @relation("AgentNodeExecutionOutput") |
|
|
|
|
|
|
|
executionStatus String |
|
|
|
executionData String? |
|
addedTime DateTime @default(now()) |
|
queuedTime DateTime? |
|
startedTime DateTime? |
|
endedTime DateTime? |
|
} |
|
|
|
|
|
model AgentNodeExecutionInputOutput { |
|
id String @id @default(uuid()) |
|
|
|
name String |
|
data String |
|
time DateTime @default(now()) |
|
|
|
|
|
referencedByInputExecId String? |
|
ReferencedByInputExec AgentNodeExecution? @relation("AgentNodeExecutionInput", fields: [referencedByInputExecId], references: [id]) |
|
referencedByOutputExecId String? |
|
ReferencedByOutputExec AgentNodeExecution? @relation("AgentNodeExecutionOutput", fields: [referencedByOutputExecId], references: [id]) |
|
|
|
|
|
@@unique([referencedByInputExecId, referencedByOutputExecId, name]) |
|
} |
|
|
|
|
|
model AgentGraphExecutionSchedule { |
|
id String @id |
|
|
|
agentGraphId String |
|
agentGraphVersion Int @default(1) |
|
AgentGraph AgentGraph @relation(fields: [agentGraphId, agentGraphVersion], references: [id, version]) |
|
|
|
schedule String |
|
isEnabled Boolean @default(true) |
|
inputData String |
|
|
|
|
|
lastUpdated DateTime @updatedAt |
|
|
|
|
|
userId String |
|
user User @relation(fields: [userId], references: [id]) |
|
|
|
@@index([isEnabled]) |
|
} |