Skip to content
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

Y24-373 - Data migration to update sample_metadata country_of_origin #4406

Open
neilsycamore opened this issue Oct 9, 2024 · 1 comment
Open
Labels
Data integrity Data Integrity Size: S Small - low effort & risk

Comments

@neilsycamore
Copy link
Contributor

Two country_of_origin of options ("not applicable: control sample" and "not applicable: sample group") have been identified and Y24-372 created to change these.

The samples in the Sequencescape and MLWH databases requires updating to reflect the changes
not applicable: control sample => missing: control sample
not applicable: sample group => missing: sample group

@neilsycamore neilsycamore added the Data integrity Data Integrity label Oct 9, 2024
@psd-issuer psd-issuer bot changed the title Data migration to update sample_metadata country_of_origin Y24-373 - Data migration to update sample_metadata country_of_origin Oct 9, 2024
@neilsycamore neilsycamore added the Size: S Small - low effort & risk label Oct 9, 2024
@neilsycamore
Copy link
Contributor Author

neilsycamore commented Oct 10, 2024

this method will update samples table in SS & MLWH

def update_country_of_origin(old_id,new_id)
  ActiveRecord::Base.transaction do
    data = Sample::Metadata.where(country_of_origin: old_id)
    data.each {|sm| sm.update!(country_of_origin: new_id)}
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data integrity Data Integrity Size: S Small - low effort & risk
Projects
None yet
Development

No branches or pull requests

1 participant