-- Step 6: Add sport column to odd_categories (2.7M rows - should be fine)

ALTER TABLE odd_categories ADD COLUMN IF NOT EXISTS sport TEXT;
ALTER TABLE odd_selections ADD COLUMN IF NOT EXISTS sport TEXT;

-- Backfill from matches
UPDATE odd_categories SET sport = m.sport
FROM matches m
WHERE odd_categories.match_id = m.id AND odd_categories.sport IS NULL;

-- Indexes for sport filtering
CREATE INDEX IF NOT EXISTS idx_odd_categories_sport ON odd_categories(sport) WHERE sport IS NOT NULL;
