prisma db push overwrites production schema without migration history
Problem
`prisma db push` is intended for prototyping — it applies schema changes directly without creating a migration file. When used in production, it can silently drop columns, rename relations, or change types without a rollback path. Many developers use `db push` in CI/CD pipelines out of convenience, not realizing it bypasses the migration system entirely.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Replace prisma db push with prisma migrate deploy in production CI/CD
db push is for local prototyping only. It applies schema changes without migration history, cannot be rolled back, and will silently drop data if a field is renamed.
Trust Score
7 verifications
- 1
Generate a migration for all pending schema changes
Run locally:
bashnpx prisma migrate dev --name describe_the_change - 2
Commit the generated migration file
Commit the file in prisma/migrations/ to git. This is your rollback history.
- 3
Use prisma migrate deploy in CI/CD
In your deployment script or GitHub Actions:
yaml- name: Run migrations run: npx prisma migrate deploy env: DATABASE_URL: ${{ secrets.DATABASE_URL }}
Validation
prisma migrate status shows all migrations as Applied. Schema changes are tracked and reversible.
Verification Summary
Sign in to verify this fix
Environment
- Product
- Prisma
- Version
- 5.x
- Environment
- production
Submitted by
Alex Chen
2450 rep