From ed0d8d23897e57eb4fefad859604070a636b0b3e Mon Sep 17 00:00:00 2001 From: Andrei Stoica Date: Fri, 26 Jan 2024 19:15:33 -0500 Subject: [PATCH] added player stats table --- sqitch/deploy/player-stats.sql | 91 ++++++++++++++++++++++++++++++++++ sqitch/revert/player-stats.sql | 8 +++ sqitch/sqitch.plan | 1 + sqitch/verify/player-stats.sql | 28 +++++++++++ 4 files changed, 128 insertions(+) create mode 100644 sqitch/deploy/player-stats.sql create mode 100644 sqitch/revert/player-stats.sql create mode 100644 sqitch/verify/player-stats.sql diff --git a/sqitch/deploy/player-stats.sql b/sqitch/deploy/player-stats.sql new file mode 100644 index 0000000..c124591 --- /dev/null +++ b/sqitch/deploy/player-stats.sql @@ -0,0 +1,91 @@ +-- 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; diff --git a/sqitch/revert/player-stats.sql b/sqitch/revert/player-stats.sql new file mode 100644 index 0000000..bcfa879 --- /dev/null +++ b/sqitch/revert/player-stats.sql @@ -0,0 +1,8 @@ +-- Revert leetify-data:player-stats from pg + +BEGIN; + +-- XXX Add DDLs here. +DROP TABLE data.player_stats; + +COMMIT; diff --git a/sqitch/sqitch.plan b/sqitch/sqitch.plan index 52021cb..8424d0e 100644 --- a/sqitch/sqitch.plan +++ b/sqitch/sqitch.plan @@ -3,3 +3,4 @@ data-schema 2024-01-25T03:19:31Z andrei # adding schema for data profile-meta [data-schema] 2024-01-25T03:28:08Z andrei # add table for profile metadata +player-stats 2024-01-26T23:39:00Z andrei # Add player-stats table diff --git a/sqitch/verify/player-stats.sql b/sqitch/verify/player-stats.sql new file mode 100644 index 0000000..e276b31 --- /dev/null +++ b/sqitch/verify/player-stats.sql @@ -0,0 +1,28 @@ +-- Verify leetify-data:player-stats on pg + +BEGIN; + +-- XXX Add verifications here. +SELECT id, gameId, gameFinishedAt, steam64Id, name, preaim, reactionTime, + accuracy, accuracyEnemySpotted, accuracyHead, shotsFiredEnemySpotted, + shotsFired, shotsHitEnemySpotted, shotsHitFriend, shotsHitFriendHead, + shotsHitFoe, shotsHitFoeHead, utilityOnDeathAvg, heFoesDamageAvg, + heFriendsDamageAvg, heThrown, molotovThrown, smokeThrown, + smokeThrownCT, smokeThrownCTGood, smokeThrownCTGoodRatio, smokeThrownCTFoes, + counterStrafingShotsAll, counterStrafingShotsBad, counterStrafingShotsGood, + counterStrafingShotsGoodRatio, flashbangHitFoe, flashbangLeadingToKill, + flashbangHitFoeAvgDuration, flashbangHitFriend, flashbangThrown, flashAssist, + score, initialTeamNumber, mvps, ctRoundsWon, ctRoundsLost, tRoundsWon, + tRoundsLost, sprayAccuracy, molotovFoesDamageAvg, molotovFriendsDamageAvg, + color, totalKills, totalDeaths, kdRatio, multi2k, multi3k, multi4k, multi5k, + hltvRating, hsp, roundsSurvived, roundsSurvivedPercentage, dpr, totalAssists, + totalDamage, tradeKillOpportunities, tradeKillAttempts, tradeKillsSucceeded, + tradeKillAttemptsPercentage, tradeKillsSuccessPercentage, + tradeKillOpportunitiesPerRound, tradedDeathOpportunities, + tradedDeathAttempts, tradedDeathAttemptsPercentage, tradedDeathsSucceeded, + tradedDeathsSuccessPercentage, leetifyRating, personalPerformanceRating, + ctLeetifyRating, tLeetifyRating, leetifyUserId, isCollector, isProPlan, + isLeetifyStaff +FROM data.player_stats; + +ROLLBACK;