Skip to content
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

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

Nurou
Copy link
Member

@Nurou Nurou commented Apr 18, 2021

Closes #728

SQL queries currently running very slow -- waiting to run on dev DB to see if results are as desired.

@codecov
Copy link

codecov bot commented Apr 18, 2021

Codecov Report

Merging #749 (8750deb) into master (06a77bf) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06a77bf...8750deb. Read the comment docs.

Copy link
Member

@nygrenh nygrenh left a 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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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 = `
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

obsolete?

@Nurou Nurou changed the title [WIP] migration for moving checkbox stuff migration for moving checkbox stuff May 3, 2021
@Nurou Nurou marked this pull request as ready for review May 3, 2021 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Older checkboxes and checkbox answers have quiz options. In some cases multiple ones
2 participants