aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/query.sql
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-20 21:38:58 +0900
committernsfisis <nsfisis@gmail.com>2026-02-20 21:38:58 +0900
commit85b7a14913c05b88b720fc546eaca5575ffe53fd (patch)
treeb19d66d3500bb4b697cf656a769a111411793cf3 /backend/query.sql
parentfa788237eb5649e08b2a38ec21689b481b10c073 (diff)
downloadphperkaigi-2026-albatross-85b7a14913c05b88b720fc546eaca5575ffe53fd.tar.gz
phperkaigi-2026-albatross-85b7a14913c05b88b720fc546eaca5575ffe53fd.tar.zst
phperkaigi-2026-albatross-85b7a14913c05b88b720fc546eaca5575ffe53fd.zip
feat(admin): add bulk rejudge for game submissions
Extract common rejudge logic into a helper method and add two new endpoints: rejudge-latest (per-user latest only) and rejudge-all. This allows re-running submissions in bulk after testcase changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'backend/query.sql')
-rw-r--r--backend/query.sql6
1 files changed, 6 insertions, 0 deletions
diff --git a/backend/query.sql b/backend/query.sql
index 1e49780..45ac46f 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -265,6 +265,12 @@ FROM submissions
WHERE game_id = $1
ORDER BY created_at DESC;
+-- name: GetLatestSubmissionsByGameID :many
+SELECT DISTINCT ON (user_id) *
+FROM submissions
+WHERE game_id = $1
+ORDER BY user_id, created_at DESC;
+
-- name: GetSubmissionByID :one
SELECT *
FROM submissions