add move query
This commit is contained in:
parent
bb90684522
commit
718380f2de
@ -568,3 +568,31 @@ FROM
|
||||
Questions
|
||||
WHERE
|
||||
Questions.percentage >= 1;
|
||||
|
||||
-- name: QuizMove :many
|
||||
WITH copy AS (
|
||||
INSERT INTO quiz (qid, accountid,fingerprinting,repeatable,note_prevented,mail_notifications,unique_answers,super,group_id, name, description, config, status, limit_answers, due_to, time_of_passing, pausable,version,version_comment, parent_ids, created_at, updated_at, questions_count, answers_count, average_time_passing)
|
||||
SELECT
|
||||
uuid_generate_v4(),
|
||||
$2,
|
||||
fingerprinting,repeatable,note_prevented,mail_notifications,unique_answers,super,
|
||||
group_id,name,description,config,status,limit_answers,due_to,time_of_passing,
|
||||
pausable,version,version_comment,parent_ids,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP,
|
||||
questions_count,answers_count,average_time_passing
|
||||
FROM
|
||||
quiz
|
||||
WHERE
|
||||
qid = $1
|
||||
RETURNING id, qid
|
||||
)
|
||||
INSERT INTO question (quiz_id, title, description, questiontype, required, deleted, page, content, version, parent_ids, created_at, updated_at)
|
||||
SELECT
|
||||
cq.id,title,description,questiontype, required,deleted,page,
|
||||
content,version,parent_ids,CURRENT_TIMESTAMP,CURRENT_TIMESTAMP
|
||||
FROM
|
||||
question q
|
||||
JOIN
|
||||
copy cq ON q.quiz_id = cq.qid
|
||||
WHERE
|
||||
q.deleted = false
|
||||
RETURNING cq.qid;
|
@ -578,3 +578,7 @@ func (r *QuizRepository) GetQuizConfig(ctx context.Context, quizID uint64) (mode
|
||||
|
||||
return config, row.Accountid, nil
|
||||
}
|
||||
|
||||
func (r *QuizRepository) QuizMove(ctx context.Context, qID, accountID string) {
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user