mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-15 09:12:18 +00:00
fix: synchronize root workflow database schema
Co-Authored-By: Ishaan Jaffer <155045088+ishaan-berri@users.noreply.github.com>
This commit is contained in:
parent
c7017b7c30
commit
ca2486e4f2
2 changed files with 74 additions and 7 deletions
|
|
@ -1997,13 +1997,6 @@ model LiteLLM_WorkflowRun {
|
|||
@@index([created_by])
|
||||
}
|
||||
|
||||
// Append-only log of state transitions. Never mutate rows here.
|
||||
// `step_name` and `event_type` are caller-defined strings — no hardcoded enums.
|
||||
// Status auto-update rules (applied by the append endpoint):
|
||||
// step.started → run.status = running
|
||||
// step.failed → run.status = failed
|
||||
// hook.waiting → run.status = paused
|
||||
// hook.received → run.status = running
|
||||
model LiteLLM_WorkflowDefinition {
|
||||
workflow_id String @id
|
||||
team_id String
|
||||
|
|
@ -2070,6 +2063,13 @@ model LiteLLM_WorkflowStep {
|
|||
@@unique([run_id, node_id])
|
||||
}
|
||||
|
||||
// Append-only log of state transitions. Never mutate rows here.
|
||||
// `step_name` and `event_type` are caller-defined strings — no hardcoded enums.
|
||||
// Status auto-update rules (applied by the append endpoint):
|
||||
// step.started → run.status = running
|
||||
// step.failed → run.status = failed
|
||||
// hook.waiting → run.status = paused
|
||||
// hook.received → run.status = running
|
||||
model LiteLLM_WorkflowEvent {
|
||||
event_id String @id @default(uuid())
|
||||
run_id String
|
||||
|
|
|
|||
|
|
@ -1986,6 +1986,7 @@ model LiteLLM_WorkflowRun {
|
|||
input Json?
|
||||
output Json?
|
||||
metadata Json?
|
||||
engine_owned Boolean @default(false)
|
||||
|
||||
events LiteLLM_WorkflowEvent[]
|
||||
messages LiteLLM_WorkflowMessage[]
|
||||
|
|
@ -1996,6 +1997,72 @@ model LiteLLM_WorkflowRun {
|
|||
@@index([created_by])
|
||||
}
|
||||
|
||||
model LiteLLM_WorkflowDefinition {
|
||||
workflow_id String @id
|
||||
team_id String
|
||||
name String
|
||||
etag String
|
||||
bundle_json String
|
||||
contributors String[]
|
||||
published_snapshot_id String?
|
||||
|
||||
@@unique([team_id, name])
|
||||
}
|
||||
|
||||
model LiteLLM_WorkflowSnapshot {
|
||||
snapshot_id String @id
|
||||
workflow_id String
|
||||
team_id String
|
||||
name String
|
||||
bundle_json String
|
||||
published_by String
|
||||
created_at DateTime @default(now())
|
||||
origin String @default("publication")
|
||||
|
||||
@@index([workflow_id])
|
||||
}
|
||||
|
||||
model LiteLLM_WorkflowExecution {
|
||||
run_id String @id
|
||||
snapshot_id String
|
||||
team_id String
|
||||
name String
|
||||
principal String
|
||||
dispatch_key String @unique
|
||||
request_digest String
|
||||
request_json String
|
||||
state String @default("pending")
|
||||
deadline DateTime
|
||||
lease_owner String?
|
||||
lease_until DateTime?
|
||||
cancel_requested Boolean @default(false)
|
||||
checkpoints Json @default("[]")
|
||||
response_json String?
|
||||
error String?
|
||||
|
||||
@@index([team_id, name])
|
||||
}
|
||||
|
||||
model LiteLLM_WorkflowStep {
|
||||
step_id String @id
|
||||
run_id String
|
||||
node_id String
|
||||
state String @default("running")
|
||||
input Json
|
||||
output Json?
|
||||
attempts Int @default(0)
|
||||
deadline DateTime
|
||||
started_at DateTime @default(now())
|
||||
finished_at DateTime?
|
||||
error String?
|
||||
prompt_tokens Int @default(0)
|
||||
completion_tokens Int @default(0)
|
||||
response_cost Float?
|
||||
request_id String?
|
||||
|
||||
@@unique([run_id, node_id])
|
||||
}
|
||||
|
||||
// Append-only log of state transitions. Never mutate rows here.
|
||||
// `step_name` and `event_type` are caller-defined strings — no hardcoded enums.
|
||||
// Status auto-update rules (applied by the append endpoint):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue