-
Notifications
You must be signed in to change notification settings - Fork 32
feat: add migration script to/from legacy history to generic history #2286
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
Conversation
daa3dae
to
8ee342b
Compare
is there a way to do this with an aggregation pipeline (or at least with a cursor)? I know it might duplicate logic, but I think to find and then loop is fairly inefficient |
|
2c4cf76
to
da1b775
Compare
ah, you are right, since this is not using mongoose but the mongo driver, my bad. I gave a quick try to see how the aggregation pipeline would look, and it's indeed a bit complex and prone to typos. Happy to use this then, let's reconsider if necessary after we test the migration |
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.
minor, comment, happy to approve otherwise
Description
Depends on #2282
Motivation
With the above PR, history for new records will be included in the datasets response. The migration script is needed to backfill the older history records as well.
Fixes
Changes:
up
migrationmigrate:db:[up|down]
to includenpm run build
, as the migration script depends on compiled dataset/utils moduleTests included
Documentation
Testing
Tested locally that up / down scripts preserve records across migration.