added player stats table

This commit is contained in:
Andrei Stoica 2024-01-26 19:15:33 -05:00
parent 0db1ffd667
commit ed0d8d2389
4 changed files with 128 additions and 0 deletions

View File

@ -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;

View File

@ -0,0 +1,8 @@
-- Revert leetify-data:player-stats from pg
BEGIN;
-- XXX Add DDLs here.
DROP TABLE data.player_stats;
COMMIT;

View File

@ -3,3 +3,4 @@
data-schema 2024-01-25T03:19:31Z andrei <andrei@tower> # adding schema for data
profile-meta [data-schema] 2024-01-25T03:28:08Z andrei <andrei@tower> # add table for profile metadata
player-stats 2024-01-26T23:39:00Z andrei <andrei@tower> # Add player-stats table

View File

@ -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;