-- Migration: Add popularity_score column for unified engagement ranking
-- Combines watchlist adds, clicks, page views, and conversions into one precomputed score

ALTER TABLE products ADD COLUMN IF NOT EXISTS popularity_score INT DEFAULT 0;

CREATE INDEX IF NOT EXISTS idx_products_popularity ON products(popularity_score DESC)
  WHERE is_sneaker = true;
