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:
parent
2c657e2b4c
commit
9b467924a0
|
|
@ -339,6 +339,7 @@ CREATE TABLE conversation_messages (
|
||||||
content TEXT NOT NULL,
|
content TEXT NOT NULL,
|
||||||
tool_calls JSONB,
|
tool_calls JSONB,
|
||||||
tool_results JSONB,
|
tool_results JSONB,
|
||||||
|
attachments JSONB,
|
||||||
token_count INTEGER,
|
token_count INTEGER,
|
||||||
sequence_number INTEGER NOT NULL,
|
sequence_number INTEGER NOT NULL,
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,15 @@ CREATE TABLE IF NOT EXISTS conversation_messages (
|
||||||
content TEXT NOT NULL,
|
content TEXT NOT NULL,
|
||||||
tool_calls JSONB,
|
tool_calls JSONB,
|
||||||
tool_results JSONB,
|
tool_results JSONB,
|
||||||
|
attachments JSONB,
|
||||||
token_count INTEGER,
|
token_count INTEGER,
|
||||||
sequence_number INTEGER NOT NULL,
|
sequence_number INTEGER NOT NULL,
|
||||||
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
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
|
CREATE INDEX IF NOT EXISTS idx_conversation_messages_session
|
||||||
ON conversation_messages(session_id, sequence_number ASC);
|
ON conversation_messages(session_id, sequence_number ASC);
|
||||||
CREATE INDEX IF NOT EXISTS idx_conversation_messages_session_recent
|
CREATE INDEX IF NOT EXISTS idx_conversation_messages_session_recent
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue