#!/bin/bash
# Run this ONCE on the server (or paste into your MySQL client) to capture
# real schema for Claude Code's Task 1. Read-only, structure only, no data.
# Usage: bash mysql_export_commands.sh > real_schema.sql
TABLES="global_sports global_sports_stats gl_ratings india_channel_subgenre_stats \
uk_channel_subgenre_stats viewership_by_hour tvuniverse map_country_map_channel \
channel_match_ratings country_alias pan_mapping event_country_interest_factor \
event_interest_factor event_country_tvuniverse_factor event_host_country_factor \
sports_team_weight match_level_weights match_level_weight_by_event \
event_fallback_mapping event_category_map fixture_interest ott_multipliers \
global_sports_ama_caps country_genre_demographics"
for t in $TABLES; do
  echo "-- ==== $t ===="
  mysql -u"$DB_USER" -p"$DB_PASS" -h"$DB_HOST" tvviewers -e "SHOW CREATE TABLE $t\G" 2>/dev/null \
    || echo "-- (table not found or access denied: $t)"
  echo
done
