generated from VLADIMIR/template
up
This commit is contained in:
@@ -78,10 +78,14 @@ func (r *GamesRepo) GetGameByID(
|
||||
games.started_at,
|
||||
games.ended_at,
|
||||
(SELECT
|
||||
jsonb_build_object(
|
||||
CASE WHEN EXISTS (
|
||||
SELECT 1
|
||||
FROM game_returns r
|
||||
WHERE r.export_id = e.id
|
||||
) THEN NULL ELSE jsonb_build_object(
|
||||
'id', e.id, 'state', e.state, 'package_id', e.package_id,
|
||||
'size', e.size, 'sha256', e.sha256, 'failure', e.failure
|
||||
)
|
||||
) END
|
||||
FROM game_exports e
|
||||
WHERE e.game_id = games.id
|
||||
ORDER BY e.created_at DESC, e.id
|
||||
@@ -148,10 +152,14 @@ func (r *GamesRepo) GetGames(
|
||||
games.format,
|
||||
games.status,
|
||||
(SELECT
|
||||
jsonb_build_object(
|
||||
CASE WHEN EXISTS (
|
||||
SELECT 1
|
||||
FROM game_returns r
|
||||
WHERE r.export_id = e.id
|
||||
) THEN NULL ELSE jsonb_build_object(
|
||||
'id', e.id, 'state', e.state, 'package_id', e.package_id,
|
||||
'size', e.size, 'sha256', e.sha256, 'failure', e.failure
|
||||
)
|
||||
) END
|
||||
FROM game_exports e
|
||||
WHERE e.game_id = games.id
|
||||
ORDER BY e.created_at DESC, e.id
|
||||
|
||||
Reference in New Issue
Block a user