Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions queries/public/match_report_cards.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
select
rca.id report_card_id,
rca."createdAt" as generated_at,
rca."sprocketId" as match_id,
rca."legacyId" as legacy_series_id,
gsgp.description as league,
gm.description as game_mode,
hfp.title as home_team,
afp.title as away_team,
up."displayName" as player_name,
rca."scrimUuid",
rca."userIds",
rca."franchiseIds",
CONCAT(
'https://report-cards.mlesports.gg/',
rca."minioKey"
) as report_card_url
from
sprocket.report_card_asset rca
inner join sprocket.match m on m.id = rca."sprocketId"
inner join sprocket.game_mode gm on gm.id = m."gameModeId"
inner join sprocket.game_skill_group_profile gsgp on gsgp."skillGroupId" = m."skillGroupId"
inner join sprocket.match_parent mp on mp.id = m."matchParentId"
inner join sprocket.schedule_fixture sf on sf.id = mp."fixtureId"
inner join sprocket.franchise_profile hfp on hfp."franchiseId" = sf."homeFranchiseId"
inner join sprocket.franchise_profile afp on afp."franchiseId" = sf."awayFranchiseId"
left join lateral unnest(rca."userIds") as user_id on true
left join sprocket.user_profile up on up."userId" = user_id
where
rca.type = 'MATCH';
8 changes: 0 additions & 8 deletions queries/public/report_cards.sql

This file was deleted.

26 changes: 26 additions & 0 deletions queries/public/scrim_report_cards.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
select
rca.id report_card_id,
rca."createdAt" as generated_at,
rca."sprocketId" as match_id,
rca."legacyId" as legacy_series_id,
gsgp.description as league,
gm.description as game_mode,
'BLUE' as home_team,
'ORANGE' as away_team,
up."displayName" as player_name,
rca."scrimUuid",
rca."userIds",
rca."franchiseIds",
CONCAT(
'https://report-cards.mlesports.gg/',
rca."minioKey"
) as report_card_url
from
sprocket.report_card_asset rca
inner join sprocket.match m on m.id = rca."sprocketId"
inner join sprocket.game_mode gm on gm.id = m."gameModeId"
inner join sprocket.game_skill_group_profile gsgp on gsgp."skillGroupId" = m."skillGroupId"
left join lateral unnest(rca."userIds") as player_id on true
left join sprocket.user_profile up on up."userId" = player_id
where
rca.type = 'SCRIM';