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

Survey Question Tweaks #529

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions microsetta_private_api/db/patches/0128.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- The "Yes, I use a copper IUD" response needs to read as "No, I use a copper IUD" as copper IUD is not hormonal.
-- Since adding that option was part of the overhaul and no one has had the opportunity to actually select it,
-- we can safely change this without breaking foreign keys on existing survey responses.
DELETE FROM ag.survey_question_response WHERE survey_question_id = 497 AND response = 'Yes, I use a copper IUD';
UPDATE ag.survey_response SET american = 'No, I use a copper IUD', spanish = 'No, uso un DIU de cobre', spain_spanish = 'No, uso un DIU de cobre' WHERE american = 'Yes, I use a copper IUD';
INSERT INTO ag.survey_question_response (survey_question_id, response, display_index) VALUES (497, 'No, I use a copper IUD', 6);

-- Change questions about sleep problems to trigger off of sleep quality question
UPDATE ag.survey_question SET css_classes = 'tmi-survey-radio-axis tmi-survey-triggered-question' WHERE survey_question_id IN (233, 234, 235);
INSERT INTO ag.survey_question_triggers (survey_question_id, triggering_response, triggered_question)
VALUES (232, 'Moderately satisfied', 233),
(232, 'Dissatisfied', 233),
(232, 'Very dissatisfied', 233),
(232, 'Moderately satisfied', 234),
(232, 'Dissatisfied', 234),
(232, 'Very dissatisfied', 234),
(232, 'Moderately satisfied', 235),
(232, 'Dissatisfied', 235),
(232, 'Very dissatisfied', 235);
Loading