-- Deploy leetify-data:player-stats to pg
-- requires: data-schema

BEGIN;

  CREATE TABLE IF NOT EXISTS data.player_stats (
    id TEXT,
    game_id TEXT,
    game_finished_at TIMESTAMP,
    steam64_id TEXT,
    name TEXT,
    preaim NUMERIC,
    reaction_time NUMERIC,
    accuracy NUMERIC,
    accuracy_enemy_spotted NUMERIC,
    accuracy_head NUMERIC,
    shots_fired_enemy_spotted NUMERIC,
    shots_fired NUMERIC,
    shots_hit_enemy_spotted NUMERIC,
    shots_hit_friend NUMERIC,
    shots_Hit_Friend_Head NUMERIC,
    shots_Hit_Foe NUMERIC,
    shots_Hit_Foe_Head NUMERIC,
    utility_On_Death_Avg NUMERIC,
    he_foes_damage_avg NUMERIC,
    he_friends_damage_avg NUMERIC,
    he_thrown NUMERIC,
    molotov_thrown NUMERIC,
    smoke_thrown NUMERIC,
    smoke_thrown_ct NUMERIC,
    smoke_thrown_ct_good NUMERIC,
    smoke_thrown_ct_good_ratio NUMERIC,
    smoke_thrown_ct_foes NUMERIC,
    counter_strafing_shots_all NUMERIC,
    counter_strafing_shots_bad NUMERIC,
    counter_strafing_shots_good NUMERIC,
    counter_strafing_shots_good_ratio NUMERIC,
    flashbang_hit_foe NUMERIC,
    flashbang_leading_to_kill NUMERIC,
    flashbang_hit_foe_avg_duration NUMERIC,
    flashbang_hit_friend NUMERIC,
    flashbang_thrown NUMERIC,
    flash_assist NUMERIC,
    score NUMERIC,
    initial_Team_Number NUMERIC,
    mvps NUMERIC,
    ct_rounds_won NUMERIC,
    ct_rounds_lost NUMERIC,
    t_rounds_won NUMERIC,
    t_rounds_lost NUMERIC,
    spray_accuracy NUMERIC,
    molotov_foes_damage_avg NUMERIC,
    molotov_friends_damage_avg NUMERIC,
    color NUMERIC,
    total_kills NUMERIC,
    total_deaths NUMERIC,
    kd_ratio NUMERIC,
    multi2k NUMERIC,
    multi3k NUMERIC,
    multi4k NUMERIC,
    multi5k NUMERIC,
    hltv_rating NUMERIC,
    hsp NUMERIC,
    rounds_survived NUMERIC,
    rounds_survived_percentage NUMERIC,
    dpr NUMERIC,
    total_assists NUMERIC,
    total_damage NUMERIC,
    trade_kill_opportunities NUMERIC,
    trade_kill_attempts NUMERIC,
    trade_kills_succeeded NUMERIC,
    trade_kill_attempts_percentage NUMERIC,
    trade_kills_success_percentage NUMERIC,
    trade_kill_opportunities_per_round NUMERIC,
    traded_death_opportunities NUMERIC,
    traded_death_attempts NUMERIC,
    traded_death_attempts_percentage NUMERIC,
    traded_deaths_succeeded NUMERIC,
    traded_deaths_success_percentage NUMERIC,
    traded_deaths_opportunities_per_round NUMERIC,
    leetify_rating NUMERIC,
    personal_performance_rating NUMERIC,
    ct_leetify_rating NUMERIC,
    t_leetify_rating NUMERIC,
    leetify_user_id TEXT,
    is_collector BOOL,
    is_pro_plan BOOL,
    is_leetify_staff BOOL
  );

COMMIT;
