-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migration for moving checkbox stuff #749
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #749 +/- ##
=======================================
Coverage 92.26% 92.26%
=======================================
Files 63 63
Lines 2003 2003
Branches 265 265
=======================================
Hits 1848 1848
Misses 149 149
Partials 6 6 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, remove extra empty quiz items and quiz item answers
DELETE FROM quiz_option_answer qoa | ||
USING quiz_item_answer qia | ||
WHERE qia.quiz_item_id IN (SELECT id FROM quiz_item WHERE type = 'checkbox') | ||
RETURNING qoa.id, qia.quiz_answer_id, qoa.quiz_option_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also created_at and updated_at from here.
checked = true
DELETE FROM quiz_option_translation qot | ||
USING quiz_option qo | ||
WHERE qo.quiz_item_id IN (SELECT id FROM quiz_item WHERE type = 'checkbox') | ||
RETURNING qot.quiz_option_id, qot.language_id, qot.title, qot.body, qot.success_message, qot.failure_message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created_at, updated_at
DELETE FROM quiz_option qo | ||
USING quiz_item qi | ||
WHERE qi.type = 'checkbox' | ||
RETURNING qo.id, qo."order", qo.deleted, 'checkbox'::quiz_item_type_enum, qi.quiz_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created_at, updated_at
SELECT * FROM moved_quiz_option_rows | ||
` | ||
|
||
const deleteQuizOptionChildren = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obsolete?
Closes #728
SQL queries currently running very slow -- waiting to run on dev DB to see if results are as desired.