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

BEGIN;

  CREATE TABLE IF NOT EXISTS data.player_stats (
    id TEXT,
    gameId TEXT,
    gameFinishedAt TIMESTAMP,
    steam64Id TEXT,
    name TEXT,
    preaim NUMERIC,
    reactionTime NUMERIC,
    accuracy NUMERIC,
    accuracyEnemySpotted NUMERIC,
    accuracyHead NUMERIC,
    shotsFiredEnemySpotted NUMERIC,
    shotsFired NUMERIC,
    shotsHitEnemySpotted NUMERIC,
    shotsHitFriend NUMERIC,
    shotsHitFriendHead NUMERIC,
    shotsHitFoe NUMERIC,
    shotsHitFoeHead NUMERIC,
    utilityOnDeathAvg NUMERIC,
    heFoesDamageAvg NUMERIC,
    heFriendsDamageAvg NUMERIC,
    heThrown NUMERIC,
    molotovThrown NUMERIC,
    smokeThrown NUMERIC,
    smokeThrownCT NUMERIC,
    smokeThrownCTGood NUMERIC,
    smokeThrownCTGoodRatio NUMERIC,
    smokeThrownCTFoes NUMERIC,
    counterStrafingShotsAll NUMERIC,
    counterStrafingShotsBad NUMERIC,
    counterStrafingShotsGood NUMERIC,
    counterStrafingShotsGoodRatio NUMERIC,
    flashbangHitFoe NUMERIC,
    flashbangLeadingToKill NUMERIC,
    flashbangHitFoeAvgDuration NUMERIC,
    flashbangHitFriend NUMERIC,
    flashbangThrown NUMERIC,
    flashAssist NUMERIC,
    score NUMERIC,
    initialTeamNumber NUMERIC,
    mvps NUMERIC,
    ctRoundsWon NUMERIC,
    ctRoundsLost NUMERIC,
    tRoundsWon NUMERIC,
    tRoundsLost NUMERIC,
    sprayAccuracy NUMERIC,
    molotovFoesDamageAvg NUMERIC,
    molotovFriendsDamageAvg NUMERIC,
    color NUMERIC,
    totalKills NUMERIC,
    totalDeaths NUMERIC,
    kdRatio NUMERIC,
    multi2k NUMERIC,
    multi3k NUMERIC,
    multi4k NUMERIC,
    multi5k NUMERIC,
    hltvRating NUMERIC,
    hsp NUMERIC,
    roundsSurvived NUMERIC,
    roundsSurvivedPercentage NUMERIC,
    dpr NUMERIC,
    totalAssists NUMERIC,
    totalDamage NUMERIC,
    tradeKillOpportunities NUMERIC,
    tradeKillAttempts NUMERIC,
    tradeKillsSucceeded NUMERIC,
    tradeKillAttemptsPercentage NUMERIC,
    tradeKillsSuccessPercentage NUMERIC,
    tradeKillOpportunitiesPerRound NUMERIC,
    tradedDeathOpportunities NUMERIC,
    tradedDeathAttempts NUMERIC,
    tradedDeathAttemptsPercentage NUMERIC,
    tradedDeathsSucceeded NUMERIC,
    tradedDeathsSuccessPercentage NUMERIC,
    tradedDeathsOpportunitiesPerRound NUMERIC,
    leetifyRating NUMERIC,
    personalPerformanceRating NUMERIC,
    ctLeetifyRating NUMERIC,
    tLeetifyRating NUMERIC,
    leetifyUserId TEXT,
    isCollector BOOL,
    isProPlan BOOL,
    isLeetifyStaff BOOL
  );

COMMIT;
