Skip to content

feat(db): add versioned migration runner and ledger - #378

Open
vbtgongithub wants to merge 1 commit into
mainfrom
codex/issue-355-migration-runner
Open

vbtgongithub wants to merge 1 commit into
mainfrom
codex/issue-355-migration-runner

Conversation

@vbtgongithub

Copy link
Copy Markdown
Collaborator

Closes #355.

I added a versioned MongoDB migration runner with migrate:up, migrate:down, and migrate: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.

Signed-off-by: VBTG <vuppubhanu18@gmail.com>
@vbtgongithub

Copy link
Copy Markdown
Collaborator Author

@VarshithReddy2006 I have implemented the changes for this issue. Please review my changes and merge this PR if everything looks good.

@VarshithReddy2006 VarshithReddy2006 added enhancement New feature or request help wanted Extra attention is needed nsoc26 level3 10 points - core logic, database changes, and complex features. labels Nov 16, 2026
@VarshithReddy2006

Copy link
Copy Markdown
Owner

Hi @vbtgongithub,

Following recent merges into \main\ (specifically PR #375), this pull request currently has a merge conflict in:

  • \�ackend/package.json\

Could you please sync your branch with \main\ and resolve the conflict?

\\�ash
git fetch origin
git merge origin/main # or git rebase origin/main

Resolve the conflict in backend/package.json and verify tests pass

git 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed level3 10 points - core logic, database changes, and complex features. nsoc26

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(migrations,m0): build versioned migration runner CLI and SchemaMigration ledger with rollback verification

2 participants