-- Add business_intel JSONB column to lead_intel
-- Stores: current_employer, pain_points, hiring_needs, budget_signals, etc.

ALTER TABLE lead_intel ADD COLUMN IF NOT EXISTS business_intel JSONB;

-- Add index for querying leads with pain points or hiring needs
CREATE INDEX IF NOT EXISTS idx_lead_intel_has_business_intel
ON lead_intel(lead_id)
WHERE business_intel IS NOT NULL;

COMMENT ON COLUMN lead_intel.business_intel IS 'Business intel extracted from calls: employer, pain_points, hiring_needs, budget_signals, decision_timeline, competitors';
