aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/db/query.sql.go
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2024-08-08 20:33:40 +0900
committernsfisis <nsfisis@gmail.com>2024-08-08 20:38:08 +0900
commitd94c9eb68e65d53f09bf3dd26ec4d61d245882ad (patch)
treeb759cf59afb9e1203e4b0e1f2aa81996cd8681d1 /backend/db/query.sql.go
parentbb62b6ff19d9f8008458d1c0ad0b8b76090f091e (diff)
downloadphperkaigi-2025-albatross-d94c9eb68e65d53f09bf3dd26ec4d61d245882ad.tar.gz
phperkaigi-2025-albatross-d94c9eb68e65d53f09bf3dd26ec4d61d245882ad.tar.zst
phperkaigi-2025-albatross-d94c9eb68e65d53f09bf3dd26ec4d61d245882ad.zip
feat(backend): add `code_hash` to `submissions` table
Diffstat (limited to 'backend/db/query.sql.go')
-rw-r--r--backend/db/query.sql.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend/db/query.sql.go b/backend/db/query.sql.go
index 5475067..dc87602 100644
--- a/backend/db/query.sql.go
+++ b/backend/db/query.sql.go
@@ -34,8 +34,8 @@ func (q *Queries) AggregateTestcaseResults(ctx context.Context, submissionID int
}
const createSubmission = `-- name: CreateSubmission :one
-INSERT INTO submissions (game_id, user_id, code, code_size)
-VALUES ($1, $2, $3, $4)
+INSERT INTO submissions (game_id, user_id, code, code_size, code_hash)
+VALUES ($1, $2, $3, $4, $5)
RETURNING submission_id
`
@@ -44,6 +44,7 @@ type CreateSubmissionParams struct {
UserID int32
Code string
CodeSize int32
+ CodeHash string
}
func (q *Queries) CreateSubmission(ctx context.Context, arg CreateSubmissionParams) (int32, error) {
@@ -52,6 +53,7 @@ func (q *Queries) CreateSubmission(ctx context.Context, arg CreateSubmissionPara
arg.UserID,
arg.Code,
arg.CodeSize,
+ arg.CodeHash,
)
var submission_id int32
err := row.Scan(&submission_id)