#!/bin/bash
# Cross-fill scores from lowercase → uppercase SportsGame records (ALL sports)
# Also backfill opponent field in PlayerGameMetric for recent rows (all sports)

export PGPASSWORD=eventheodds_dev_password
DB_CMD="psql -h 127.0.0.1 -p 5433 -U eventheodds -d eventheodds_sports"

echo "[$(date)] Running all-sports score crossfill..."
$DB_CMD -f /var/www/html/eventheodds/scripts/crossfill_all_sports.sql 2>&1

echo "[$(date)] Running NBA opponent backfill (recent 7 days)..."
$DB_CMD -f /var/www/html/eventheodds/scripts/cron_opponent_backfill.sql 2>&1

echo "[$(date)] Done."
