-- Add link preview columns to posts table
ALTER TABLE public.posts
  ADD COLUMN IF NOT EXISTS link_preview_url TEXT,
  ADD COLUMN IF NOT EXISTS link_preview_title TEXT,
  ADD COLUMN IF NOT EXISTS link_preview_description TEXT,
  ADD COLUMN IF NOT EXISTS link_preview_image_url TEXT,
  ADD COLUMN IF NOT EXISTS link_preview_site_name TEXT;

-- Index for quick lookups when enriching posts
CREATE INDEX IF NOT EXISTS idx_posts_link_preview ON public.posts (id) WHERE link_preview_url IS NOT NULL;
