Rename location_id on patient_locations (part 2 of 3)#6744
Open
thomasleese wants to merge 2 commits intorename-patient-location-location-id-1from
Open
Rename location_id on patient_locations (part 2 of 3)#6744thomasleese wants to merge 2 commits intorename-patient-location-location-id-1from
location_id on patient_locations (part 2 of 3)#6744thomasleese wants to merge 2 commits intorename-patient-location-location-id-1from
Conversation
This changes the `school_id` column on the `patient_locations` table to ensure that it cannot be a `NULL` value, in preparation for it to replace the `location_id` column. At the same time, this makes the `location_id` column allowed to be `NULL`, and removes some related indexes. Jira-Issue: MAV-7115 Jira-Issue: MAV-7113
This stops reading from and writing to the `location_id` column on `patient_locations` and replaces this with the `school_id` column. We're doing this as we're renaming this column, and once we're safely no longer using it, we can drop `location_id` from the table. Jira-Issue: MAV-7115 Jira-Issue: MAV-7113
location_id on patient_locations (part 2 of 3)location_id on patient_locations (part 2 of 3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the second part of renaming the
location_idcolumn onpatient_locationstoschool_id. To ensure a zero-downtime migration, we need to rename the column in multiple parts.We're renaming the column to
school_idas the table itself is going to be renamed topatient_schools, to better reflect the fact that this is used to model the relationship between children and their school. Although it currently, and will for now continue, to be used for clinic sessions as well, this will eventually be replaced by a different model as the relationship between children and clinics works differently.Depends on #6743
Jira Issue - MAV-7115 · Jira Issue - MAV-7113