update InsertAnswers query

This commit is contained in:
Pavel 2024-06-01 20:51:11 +03:00
parent 70b7251bc7
commit 8bca2a49aa

@ -291,7 +291,7 @@ WHERE
a.session = $1 AND a.start = false AND a.deleted = false
ORDER BY
a.question_id ASC, a.created_at DESC;
-- name: InsertAnswers :exec
-- name: InsertAnswers :one
INSERT INTO answer(
content,
quiz_id,
@ -307,7 +307,8 @@ INSERT INTO answer(
ip,
start,
utm
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14);
) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14)
RETURNING *;
-- name: GetResultAnswers :many
SELECT DISTINCT on (question_id) id, content, quiz_id, question_id, fingerprint, session,created_at, result, new,deleted, device_type,device,os,browser,ip FROM answer WHERE session = (