-- CF-1316: Add LLM-extracted metadata JSONB column for filtered retrieval
-- Schema: { topics: string[], decisions: string[], blockers: string[], tools_used: string[], projects: string[], issue_keys: string[] }

ALTER TABLE sessions ADD COLUMN IF NOT EXISTS extracted_metadata JSONB;

-- GIN index for fast JSONB containment queries (@>)
CREATE INDEX IF NOT EXISTS idx_sessions_extracted_metadata ON sessions USING GIN(extracted_metadata);
