fix: add attachments JSONB column to conversation_messages schema

Update migration files to include the attachments column for
multimodal image storage. Also add ALTER TABLE migration for
existing deployments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-02-28 04:18:35 -08:00
parent 2c657e2b4c
commit 9b467924a0
2 changed files with 5 additions and 0 deletions

View File

@ -339,6 +339,7 @@ CREATE TABLE conversation_messages (
content TEXT NOT NULL,
tool_calls JSONB,
tool_results JSONB,
attachments JSONB,
token_count INTEGER,
sequence_number INTEGER NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()

View File

@ -13,11 +13,15 @@ CREATE TABLE IF NOT EXISTS conversation_messages (
content TEXT NOT NULL,
tool_calls JSONB,
tool_results JSONB,
attachments JSONB,
token_count INTEGER,
sequence_number INTEGER NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Migration: Add attachments column to existing tables
ALTER TABLE conversation_messages ADD COLUMN IF NOT EXISTS attachments JSONB;
CREATE INDEX IF NOT EXISTS idx_conversation_messages_session
ON conversation_messages(session_id, sequence_number ASC);
CREATE INDEX IF NOT EXISTS idx_conversation_messages_session_recent