microbiomedata / nmdc-schema

National Microbiome Data Collaborative (NMDC) unified data model
https://microbiomedata.github.io/nmdc-schema/
Creative Commons Zero v1.0 Universal
26 stars 8 forks source link

Update `FailureWhereEnum` to reflect updated class names #1996

Closed kheal closed 1 month ago

kheal commented 1 month ago

Enum values do not reflect refactored classes.

This will require a migration.

kheal commented 1 month ago

@brynnz22, can you help out with the migration script?

brynnz22 commented 1 month ago

@kheal There is a migrator that does a similar thing you can look at here: https://github.com/microbiomedata/berkeley-schema-fy24/pull/59. This might help you get started.

kheal commented 1 month ago

@brynnz22 - excellent, I'll give it a go.

brynnz22 commented 1 month ago

Before you try this, I'd recommend checking Mongo to see if any collections are actually impacted by this schema change. If not, it won't require a migration. It looks like it would only require a migration if the value is one of the enums with Activity in the name. I know that the failure categorization is a new group of slots and so it has not been used a whole lot

brynnz22 commented 1 month ago

It looks like it will - Some of them have OmicsProcessing instead of DataGeneration

brynnz22 commented 1 month ago

And by some - It looks like its just one record in all of mongo that uses it - part of the read_qc_analysis_set with id: nmdc:wfrqc-11-tvnq1669.1. Should be an easy migrator to write!

eecavanna commented 1 month ago

I have a different view about the necessity of a migrator. I want migrators to exist whenever there is the potential that valid data become invalid when the schema changes. That is as opposed to it being only if there is current data that would become invalid. The reason is that I don't know what the database will contain at the time the migrators get run.

kheal commented 1 month ago

@eecavanna That makes sense, thanks for the clarification!