sanger / sequencescape

Web based LIMS
MIT License
80 stars 32 forks source link

Y24-108 Asset renaming - Barcode model - database changes #4123

Open KatyTaylor opened 1 month ago

KatyTaylor commented 1 month ago

Describe the Housekeeping

  1. Rename the database column asset_id on the barcodes table to labware_id.
  2. Remove the aliases on the model that were added in https://github.com/sanger/sequencescape/issues/4121\

Code references will have already been updated in https://github.com/sanger/sequencescape/issues/4121

Test the database change on training first, and consider running it by the DBAs.

Test the rollback plan as well, as we may get production issues if any code references have been missed.

Write up any learnings as you go, to help with future stories on different models.

Blocking issues

Additional context A more complicated but potentially safer approach that could be considered is to do this in several steps:

  1. Rename the column, remove the aliases, and add in the reverse aliases (feature flagged?). This means any code references that were missed would be less likely to cause issues in this step.
  2. Feature flag the reverse aliases off. If any production issues popped up in this step, we could just turn the feature flag back on while we fix them.
  3. Remove the reverse aliases and feature flag once we're confident we've got all the code references.

By 'reverse alias', I mean the following (compare to those suggested here - https://github.com/sanger/sequencescape/issues/4121#issue-2308236994):

alias_attribute :asset_id, :labware_id
alias_attribute :asset, :labware

This story came out of the following research story. This has more detail and results of investigations that could be useful to read: