From d8d3375a3ccc9b4c0e5bb005ef6ec320861043ed Mon Sep 17 00:00:00 2001 From: Julio Quinteros Pro Date: Wed, 4 Mar 2026 11:27:51 -0300 Subject: [PATCH] Add missing migration for LiteLLM_ToolTable policy changes PR #22732 changed the ToolTable schema (renamed call_policy to input_policy, added output_policy/user_agent/last_used_at columns, updated indexes) but didn't include a migration for these changes. Co-Authored-By: Claude Opus 4.6 --- .../migration.sql | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 litellm-proxy-extras/litellm_proxy_extras/migrations/20260303000000_update_tool_table_policies/migration.sql diff --git a/litellm-proxy-extras/litellm_proxy_extras/migrations/20260303000000_update_tool_table_policies/migration.sql b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260303000000_update_tool_table_policies/migration.sql new file mode 100644 index 0000000000..2e2d722ed4 --- /dev/null +++ b/litellm-proxy-extras/litellm_proxy_extras/migrations/20260303000000_update_tool_table_policies/migration.sql @@ -0,0 +1,20 @@ +-- Rename call_policy to input_policy +ALTER TABLE "LiteLLM_ToolTable" RENAME COLUMN "call_policy" TO "input_policy"; + +-- Add output_policy column +ALTER TABLE "LiteLLM_ToolTable" ADD COLUMN "output_policy" TEXT NOT NULL DEFAULT 'untrusted'; + +-- Add user_agent column +ALTER TABLE "LiteLLM_ToolTable" ADD COLUMN "user_agent" TEXT; + +-- Add last_used_at column +ALTER TABLE "LiteLLM_ToolTable" ADD COLUMN "last_used_at" TIMESTAMP(3); + +-- Drop old index on call_policy +DROP INDEX IF EXISTS "LiteLLM_ToolTable_call_policy_idx"; + +-- CreateIndex +CREATE INDEX "LiteLLM_ToolTable_input_policy_idx" ON "LiteLLM_ToolTable"("input_policy"); + +-- CreateIndex +CREATE INDEX "LiteLLM_ToolTable_output_policy_idx" ON "LiteLLM_ToolTable"("output_policy");