-- Step 4: Copy AI features data (actual schema match)

INSERT INTO football_ai_features (
    match_id, home_elo, away_elo, home_form_score, away_form_score,
    missing_players_impact, calculator_ver, updated_at
)
SELECT 
    match_id, home_elo, away_elo, home_form_score, away_form_score,
    missing_players_impact, calculator_ver, updated_at
FROM match_ai_features
WHERE EXISTS (SELECT 1 FROM matches m WHERE m.id = match_ai_features.match_id AND m.sport = 'football');

-- For basketball, map available columns
INSERT INTO basketball_ai_features (
    match_id, home_elo, away_elo, home_form_score, away_form_score,
    missing_players_impact, calculator_ver, updated_at
)
SELECT 
    match_id, home_elo, away_elo, home_form_score, away_form_score,
    missing_players_impact, calculator_ver, updated_at
FROM match_ai_features
WHERE EXISTS (SELECT 1 FROM matches m WHERE m.id = match_ai_features.match_id AND m.sport = 'basketball');
