Repository navigation
feat(db): add versioned migration runner and ledger - #378
Open
vbtgongithub wants to merge 1 commit into
Open
vbtgongithub wants to merge 1 commit into
vbtgongithub wants to merge 1 commit into
Conversation
Signed-off-by: VBTG <vuppubhanu18@gmail.com>
Collaborator
Author
|
@VarshithReddy2006 I have implemented the changes for this issue. Please review my changes and merge this PR if everything looks good. |
Owner
|
Hi @vbtgongithub, Following recent merges into \main\ (specifically PR #375), this pull request currently has a merge conflict in:
Could you please sync your branch with \main\ and resolve the conflict? \\�ash Resolve the conflict in backend/package.json and verify tests passgit push origin codex/issue-355-migration-runner Once the conflict is resolved and CI checks pass, we will proceed with the review and merge. Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #355.
I added a versioned MongoDB migration runner with
migrate:up,migrate:down, andmigrate:status. I added a SHA-256 ledger, a lock that serializes migration runs, and a production API startup check for pending or invalid migrations. On a replica set, each forward migration commits its writes and ledger entry together, and rollback runs in reverse order in one transaction per batch.I ran the backend build and typecheck, 8 migration tests, and 18 related regression tests. I also smoke-tested the compiled CLI against a disposable MongoDB replica set and verified that the production API exits before listening when a migration is pending.
I kept the existing ad hoc migration entry points. I tested with disposable local MongoDB instances. On standalone MongoDB, an interrupted migration can leave partial writes and requires manual recovery. I documented the release and recovery steps in
DEPLOYMENT.md.