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

Implement migrator that consolidates PlannedProcess grandchild collections #196

Conversation

eecavanna
Copy link

In this branch, I implemented a migrator that accommodates the schema changes made in PR #195.

This migrator deals with collections representing grandchild classes and child classes of the PlannedProcess class. For each child class, this migrator moves all documents from the collections representing that child's child classes (i.e. the grandchild classes of the PlannedProcess class) into their "parent" collection (i.e. the collection representing the child class of the PlannedProcess class); then, deletes those "grandchild" collections.

This migrator creates a collection for each "parent" class (there are 7 of them). Whether that collection will contain any documents depends upon whether it or any of its "child" collections contain any when this migrator is run.

This migrator was designed to run after all currently-implemented migrators run (as indicated by its name, it was designed to run on a database that has been migrated "to PR104" already).

Merging this PR branch will fix microbiomedata#2045.

@eecavanna
Copy link
Author

eecavanna commented Jun 6, 2024

Thanks for reviewing this @turbomam. @aclum, given that you implemented the associated schema change, I would like for you to take a look at this migrator before I merge it in. I will merge it in this evening (I'll work on the other migrators in the meantime).

@kheal
Copy link

kheal commented Jun 7, 2024

Looks good to me, but I don't have the ability to check it on Mongo, so I just checked the logic as best I could.

@eecavanna
Copy link
Author

Thanks, @kheal. The part I typically struggle with is translating a schema change into requirements for a migrator. Knowing that the logic looked OK to you was reassuring to me.

@eecavanna eecavanna merged commit fc2d960 into main Jun 7, 2024
2 checks passed
@eecavanna eecavanna deleted the 2045-berkeley-schema-fy24-implement-migrator-that-merges-some-collections branch June 7, 2024 22:22
"metatranscriptome_assembly_set",
"metatranscriptome_annotation_set",
"metatranscriptome_analysis_set",
"mags_analysis_set",
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The collection's name is mags_set, not mags_analysis_set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

berkeley-schema-fy24: Implement migrator that merges some collections
3 participants