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

Migrations: Implement bookkeeping so database tells us which schema it conforms to #432

Closed
eecavanna opened this issue Jan 6, 2024 · 3 comments · Fixed by #487
Closed
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@eecavanna
Copy link
Collaborator

eecavanna commented Jan 6, 2024

In other words, the database would "know" (tell us) what migrations have been applied to it; or at least which one was applied to it most recently.

@eecavanna eecavanna added documentation Improvements or additions to documentation enhancement New feature or request labels Jan 6, 2024
@eecavanna eecavanna self-assigned this Jan 6, 2024
@eecavanna eecavanna changed the title Migrations: Implement bookkeeping so database tells us what schema version it thinks it conforms to Migrations: Implement bookkeeping so database tells us which schema it conforms to Jan 20, 2024
@eecavanna
Copy link
Collaborator Author

eecavanna commented Feb 11, 2024

I plan to implement this as part of the standard code run by the Python notebooks used for migration. The notebooks could create a document at the beginning of the migration process; something like: { "from": __, "to": __, "start_time": "...", "end_time": null }. Then, at the end of the migration process, the notebook could update the document to have a non-null end_time. To determine the current schema version, a user could sort the documents by their end_time (the to value of the document having the latest end_time would be the schema version the database is "at").

Alternatively (or in addition), the notebook could also update some single/global nmdc_schema_version field to indicate the schema version to which the database was updated most recently. Then, a user could check that single nmdc_schema_version field as a quick way of checking (effectively) what schema version the database is "at".

@eecavanna
Copy link
Collaborator Author

Sprint planning note: There's a chance that this will be done on Friday afternoon, but I think it's more likely that it will spill over into next sprint.

@ssarrafan
Copy link

Moving to next sprint @eecavanna

@eecavanna eecavanna linked a pull request Mar 5, 2024 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants