CREATE TABLE event_chunks (
    chunk_id INTEGER PRIMARY KEY AUTOINCREMENT,
    message_id TEXT NOT NULL,
    chunk_index INTEGER NOT NULL,
    total_chunks INTEGER NOT NULL,
    chunk_data TEXT NOT NULL,
    conversation_key TEXT NOT NULL,
    created_at INTEGER NOT NULL,
    UNIQUE(message_id, chunk_index)
);

CREATE INDEX idx_event_chunks_message_id ON event_chunks(message_id);
CREATE INDEX idx_event_chunks_created_at ON event_chunks(created_at); 