-- Migration 003: Add embedding column to epics table
-- Enables semantic search for epics

-- Add embedding column to epics table
ALTER TABLE epics ADD COLUMN IF NOT EXISTS embedding vector(1024);

-- Create HNSW index for fast vector similarity search
CREATE INDEX IF NOT EXISTS idx_epics_embedding ON epics USING hnsw (embedding vector_cosine_ops);

-- Record migration
INSERT INTO schema_migrations (version, applied_at) VALUES ('003_epics_embedding', NOW())
ON CONFLICT DO NOTHING;
