187384622/new email model - PR3 - Add schema migration to drop old email columns and Adjust Relevant Dependencies #52
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.
Pivotal Tracker Link
What this PR does:
This pull request is the third in a series intended to facilitate easier code review. The first PR can be found
here. The second PR can be found here.
For this PR, it aims to have a schema migration to drop the old email & personal_email column from
Teacher
model. It also adjust some old code that has dependencies on the old email fields. For example,personal_email || email_addresses.where(primary: false)&.pluck(:email)&.first
now becomesemail_addresses.find_by(primary: true)&.email
Include screenshots, videos, etc.
Original DB State
DB State : After
rails db:migrate
Frontend works fine as before
Who authored this PR?
How should this PR be tested?
Are there any complications to deploying this?
Yes. Run
rails db:migrate
to apply the migration.Checklist:
michael/12345-add-new-feature
Any branch name will do as long as the story ID is there. You can usegit checkout -b [new-branch-name]
)