-
Notifications
You must be signed in to change notification settings - Fork 33
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
Update sample_public_name for RVI Program - Bait Capture study #4594
Conversation
…ent updates if needed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #4594 +/- ##
===========================================
+ Coverage 89.38% 89.41% +0.03%
===========================================
Files 1406 1406
Lines 30298 30298
===========================================
+ Hits 27081 27091 +10
+ Misses 3217 3207 -10 ☔ View full report in Codecov by Sentry. |
Notes for testing on training :
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The SQL looks good, and the query to check before and after deployment looks good too . I’m just wondering, as the migration is in a change
block, what would happen if this migration were to be rolled back? I am not sure, in previous similar situations, whether updates like this are best in a rake task, which can be ran the one from the command line on the server. Just a thought, maybe gather opinions from others with more Rails knowledge
@harrietc52 thank you for reviewing it, it is a good point! I created it as a rake task in the first place and @KatyTaylor suggested to to use the ORM so the update triggers the event to update the mlwh accordingly. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I see it, the query retrieves records for which the sample_public_name
is null
, and sanger_sample_id
starts with RVI
, and study name is RVI Program - Bait Capture
, and sets the sample_public_name
to sanger_sample_id
.
A set of small questions:
- Do we need to check for records in which
sample_public_name
is empty as well? I assume the field is of type string (VARCHAR
). - Do we need to set
autocommit
manually? As far as I know, Rails migrations are automatically wrapped around a transaction1. - What would happen we need to rollback the migration? I think this migration is reversible but better to check2.
Footnotes
|
Thank you @dasunpubudumal for revieing it, The sample_public_name check ensures that user-specified names are not overridden. I was unaware that data updates are excluded from Rails rollbacks, so I will likely need to update this accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it, but looks good. Better to do this in UAT and record the time it takes.
No description provided.