Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
ALTER TABLE application
DROP FOREIGN KEY fk_application_first_choice_university_info_for_apply_id,
DROP FOREIGN KEY fk_application_second_choice_university_info_for_apply_id,
DROP FOREIGN KEY fk_application_third_choice_university_info_for_apply_id;

DROP INDEX idx_app_first_choice_term_id_search ON application;
DROP INDEX idx_app_second_choice_term_id_search ON application;
DROP INDEX idx_app_third_choice_term_id_search ON application;

ALTER TABLE application
DROP COLUMN first_choice_university_info_for_apply_id,
DROP COLUMN second_choice_university_info_for_apply_id,
DROP COLUMN third_choice_university_info_for_apply_id;
Comment on lines +11 to +13

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Backfill choices before dropping legacy columns

In databases that already contain applications created before the application_choice table was introduced, the repo migrations never copy first_choice_university_info_for_apply_id, second_choice_university_info_for_apply_id, or third_choice_university_info_for_apply_id into application_choice (checked V50 through V55, and current queries read only Application.choices). Dropping these columns here permanently discards those users' stored choices; add an INSERT INTO application_choice ... SELECT ... FROM application backfill for each non-null choice order before the drop.

Useful? React with 👍 / 👎.

Loading