Files
coder/coderd/database/migrations/000525_chat_context_resources.down.sql
T
Kyle Carberry 53a6459ecd feat(coderd/database): add chat_context_resources table (#26430)
Adds chat_context_resources: a per-chat pinned copy of the agent context
resources a chat is hydrated against. The agent-side table
(workspace_agent_context_resources) is last-writer-wins with no history,
so a chat copies its resources at hydration/refresh to keep a stable view
while the agent drifts.

Schema foundation only (no queries/dbauthz/prepareGeneration/SDK yet).
chat_id FK ON DELETE CASCADE for cleanup parity; no agent FK so the pin
survives agent replacement; PK (chat_id, source); reuses the 000522 enum
types.
2026-06-16 14:28:57 -07:00

5 lines
230 B
SQL

-- The workspace_agent_context_* enum types are owned by migration
-- 000522 and are still in use by workspace_agent_context_resources, so
-- they are intentionally left in place here.
DROP TABLE IF EXISTS chat_context_resources;