-- This SQL script updates the display order of questions in the registration form section for program_id 599
-- with program_id 599 for UAT
-- This is to update the display order of questions in the registration form section for program_id 599
UPDATE hdb_program_question SET display_order = 0  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 328;
UPDATE hdb_program_question SET display_order = 1  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 329;
UPDATE hdb_program_question SET display_order = 2  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 330;
UPDATE hdb_program_question SET display_order = 3  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 331;
UPDATE hdb_program_question SET display_order = 4  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 332;
UPDATE hdb_program_question SET display_order = 5  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 381;
UPDATE hdb_program_question SET display_order = 6  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1123;
UPDATE hdb_program_question SET display_order = 7  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1079;
UPDATE hdb_program_question SET display_order = 8  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 333;
UPDATE hdb_program_question SET display_order = 9  WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1129;
UPDATE hdb_program_question SET display_order = 10 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1097;
UPDATE hdb_program_question SET display_order = 11 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1098;
UPDATE hdb_program_question SET display_order = 12 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1099;
UPDATE hdb_program_question SET display_order = 13 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 335;
UPDATE hdb_program_question SET display_order = 14 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1085;
UPDATE hdb_program_question SET display_order = 15 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1086;
UPDATE hdb_program_question SET display_order = 16 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 575;
UPDATE hdb_program_question SET display_order = 17 WHERE program_id = 599 AND form_section_id = 1 AND question_id = 1080;


-- without program_id for dev
-- This is to update the display order of questions in the registration form section
UPDATE hdb_program_question SET display_order = 0 WHERE form_section_id = 1 AND question_id = 328;
UPDATE hdb_program_question SET display_order = 1 WHERE form_section_id = 1 AND question_id = 329;
UPDATE hdb_program_question SET display_order = 2 WHERE form_section_id = 1 AND question_id = 330;
UPDATE hdb_program_question SET display_order = 3 WHERE form_section_id = 1 AND question_id = 331;
UPDATE hdb_program_question SET display_order = 4 WHERE form_section_id = 1 AND question_id = 332;
UPDATE hdb_program_question SET display_order = 8 WHERE form_section_id = 1 AND question_id = 333;
UPDATE hdb_program_question SET display_order = 9 WHERE form_section_id = 1 AND question_id = 1158;
UPDATE hdb_program_question SET display_order = 5 WHERE  form_section_id = 1 AND question_id = 381;
UPDATE hdb_program_question SET display_order = 6 WHERE  form_section_id = 1 AND question_id = 1125;
UPDATE hdb_program_question SET display_order = 13 WHERE form_section_id = 1 AND question_id = 335;
UPDATE hdb_program_question SET display_order = 16 WHERE form_section_id = 1 AND question_id = 575;
UPDATE hdb_program_question SET display_order = 7 WHERE  form_section_id = 1 AND question_id = 1079;
UPDATE hdb_program_question SET display_order = 17 WHERE form_section_id = 1 AND question_id = 1080;
UPDATE hdb_program_question SET display_order = 14 WHERE form_section_id = 1 AND question_id = 1085;
UPDATE hdb_program_question SET display_order = 15 WHERE form_section_id = 1 AND question_id = 1086;
UPDATE hdb_program_question SET display_order = 10 WHERE form_section_id = 1 AND question_id = 1097;
UPDATE hdb_program_question SET display_order = 11 WHERE form_section_id = 1 AND question_id = 1098;
UPDATE hdb_program_question SET display_order = 12 WHERE form_section_id = 1 AND question_id = 1099;

-- This SQL script updates the display order of questions in the registration form section for program_id 759
-- with program_id 759 for DEV
UPDATE hdb_program_question SET display_order = 0 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 328;
UPDATE hdb_program_question SET display_order = 1 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 329;
UPDATE hdb_program_question SET display_order = 2 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 330;
UPDATE hdb_program_question SET display_order = 3 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 331;
UPDATE hdb_program_question SET display_order = 4 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 332;
UPDATE hdb_program_question SET display_order = 8 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 333;
UPDATE hdb_program_question SET display_order = 9 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1158;
UPDATE hdb_program_question SET display_order = 5 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 381;
UPDATE hdb_program_question SET display_order = 6 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1125;
UPDATE hdb_program_question SET display_order = 13 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 335;
UPDATE hdb_program_question SET display_order = 16 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 575;
UPDATE hdb_program_question SET display_order = 7 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1079;
UPDATE hdb_program_question SET display_order = 17 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1080;
UPDATE hdb_program_question SET display_order = 14 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1085;
UPDATE hdb_program_question SET display_order = 15 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1086;
UPDATE hdb_program_question SET display_order = 10 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1097;
UPDATE hdb_program_question SET display_order = 11 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1098;
UPDATE hdb_program_question SET display_order = 12 WHERE program_id = 759 AND form_section_id = 1 AND question_id = 1099;

-- add isRequired to the question
select * from public.hdb_question where created_by =-2 and form_Section_id = (3) and id in (1058,1057,357,356,354,355,1096,1059,353)


