Skip to content

rollback ci script#760

Open
OmniZlatoon wants to merge 1 commit into
StellarDevHub:mainfrom
OmniZlatoon:rollback=branch
Open

rollback ci script#760
OmniZlatoon wants to merge 1 commit into
StellarDevHub:mainfrom
OmniZlatoon:rollback=branch

Conversation

@OmniZlatoon

Copy link
Copy Markdown

Database Migration Rollback Checker Implementation

This walkthrough outlines the changes made to introduce an automated CI testing script that verifies the safe rollback of database migrations in the Web3 Student Lab project.

Overview of Changes
To ensure database schema integrity post-rollback, the CI pipeline is now configured to test if the latest database migration can execute a clean rollback loop without data corruption or dangling schema artifacts.

1. Rollback Test Script (backend/scripts/test-migration-rollback.sh)
Since Prisma does not natively generate or store down.sql scripts, we introduced a bash script to dynamically simulate the rollback process:

It creates a temporary directory simulating the previous migration state (N-1).
It migrates the test database to the latest state (N).
It uses npx prisma migrate diff to compare the N state with the N-1 state and generates a dynamic down.sql script to undo the latest changes.
It executes the down.sql via npx prisma db execute.
It performs a final verification check using npx prisma migrate diff --exit-code to ensure the current database schema accurately matches the schema of the N-1 state.
2. NPM Script (backend/package.json)
A new script "test:migrations" was added to execute the bash script:

json
"test:migrations": "bash scripts/test-migration-rollback.sh"

3. CI Pipeline Integration (.github/workflows/ci.yml)
The GitHub Actions workflow for the backend was updated to invoke this script. The Test Migration Rollbacks step is strategically placed after the initial Prisma Generate & Migrate step.

closes #742

@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

@OmniZlatoon is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 26, 2026

Copy link
Copy Markdown

@OmniZlatoon Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@OmniZlatoon

Copy link
Copy Markdown
Author

Hello maintainer, I have completed the task. Please review

@OmniZlatoon

Copy link
Copy Markdown
Author

good morning maintainer, I have completed the task. please review PR

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.

[Backend] Build Automated Database Migration Rollback Checker

1 participant