[CI] Stop masking broken Prisma migrations with db push --accept-data-loss
Overview & Background
Ephemeral environments paper over migration failures with npx prisma db push --accept-data-loss: .github/workflows/pr-preview.yml:87-92 (whose comment admits "the committed 20260221132622_init migration fails on a fresh database") and scripts/deploy-preview.sh:85-90 both fall back to db push. Production (render.yaml:9) runs only prisma migrate deploy with no fallback — so if the comment is true, a fresh production database fails to boot; if stale, the fallback silently masks drift. backend/prisma/migrations/ also contains contradictory duplicates (20260830000000 vs 20260926000000 both adding IndexerDeadLetterEvent, the latter starting with DROP TABLE IF EXISTS ... CASCADE), plus several same-timestamp pairs.
Technical Specification & Architecture
- Repair
20260221132622_init(or squash the history) somigrate deploypasses on an empty DB. - Add a CI job that runs
prisma migrate deployagainst a truly fresh database on every migration change. - Delete the
db push --accept-data-lossfallbacks frompr-preview.ymlanddeploy-preview.sh. - Reconcile the duplicate dead-letter migrations so replaying history never drops data.
Target Files
backend/prisma/migrations/.github/workflows/pr-preview.ymlscripts/deploy-preview.shrender.yaml
Acceptance Criteria
- [ ]
prisma migrate deploysucceeds on a fresh database with no fallback. - [ ] CI verifies fresh-DB migration replay.
- [ ] No
--accept-data-lossin any workflow or script. - [ ] Migration history has no contradictory duplicate entries.
@Bashibawa has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
Hi Maintainer, I would like to work on this issue
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Bashibawa to this issue.
@Ayomikun2005 has applied to work on this issue as part of the Stellar Wave Program's 11th wave.
allow me do thus
ℹ️ Repo Maintainers: To accept this application, review their application or assign @Ayomikun2005 to this issue.
Congratulations, @Ayomikun2005! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on November 25, 2026.
🧑💻 @Ayomikun2005: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.
[!WARNING] When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.
🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.
🌊 Happy Wave 🌊
This issue has been completed by @Ayomikun2005 as part of the Stellar Wave Program's 11th Wave 🥳
😎 @Ayomikun2005: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.
🧑💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.