the right thing to do would be to run this in some CI/CD solution like github actions, vercel should only deal with building and running the app. but who cares, just run "prisma migrate deploy && next build" and you are good to go. Answer from fgc17 on reddit.com
🌐
Prisma
prisma.io › home › development and production › development and production › development and production › development and production
Development and production | Prisma Documentation
See: Team development with Prisma Migrate . In production and testing environments, use the migrate deploy command to apply migrations:
🌐
Reddit
reddit.com › r/nextjs › how do i `prisma migrate deploy` in a production environment..?
r/nextjs on Reddit: How do I `prisma migrate deploy` in a production environment..?
February 6, 2025 -

Feel like I'm missing something really basic here; I've massively changed my Prisma schema between production and dev as I decided to completely rethink my logic.

I have an existing Vercel deployment - but I actually have no idea how to run `prisma migrate deploy` in production. I'm thinking of just adding it to the build command as a one off, and then drop it for further deployments.

Does that sound right or is there a more sensible/elegant way to run the command in my production environment?

🌐
Reddit
reddit.com › r/node › how are you deploying prisma migrations in prod?
r/node on Reddit: How are you deploying Prisma migrations in prod?
May 29, 2025 -

important dazzling scary obtainable pie fear angle offer mountainous sink

This post was mass deleted and anonymized with Redact

🌐
DEV Community
dev.to › whoffagents › prisma-migrations-in-production-zero-downtime-strategies-and-rollback-patterns-3nf1
Prisma Migrations in Production: Zero-Downtime Strategies and Rollback Patterns - DEV Community
April 9, 2026 - # Development: create migration from schema changes npx prisma migrate dev --name add_display_name # Preview what will run in production npx prisma migrate status # Production: apply pending migrations npx prisma migrate deploy
🌐
Jack Pordi
jackpordi.com › posts › prisma-in-production
Prisma in Production: A review
This one's pretty simple - Prisma supports not only running your migrations for you, but also generating them from changes in your Prisma schema. This isn't really a groundbreaking feature, but a nice one to have nonetheless. One thing I initially disliked is that it didn't have rollback migrations, which is something that many other database migration systems have. However, upon some thought I realized that this is probably the more correct design choice anyways. After all, once you deploy a migration in production, it's deployed and any "down" migrations aren't guaranteed to actually reverse the effects of the forward migration, e.g.
Find elsewhere
🌐
Kitemetric
kitemetric.com › blogs › mastering-prisma-migrations-dev-vs-deploy
Mastering Prisma Migrations: Dev vs. Deploy | Kite Metric
Master Prisma's database migration commands: `migrate dev` for local development and `migrate deploy` for production. Learn the key differences and best practices for safe and efficient schema management.
🌐
Medium
medium.com › @bryantbrock › data-migrations-with-prisma-94909cb0c0c0
Data migrations with Prisma. For production applications (and… | by Bryant Brock | Medium
December 19, 2023 - First run the npx prisma migrate deploycommand (should be setup in your build scripts before the new code is deployed live) and then start your app in production.
🌐
Wasp
wasp.sh › blog › 2025 › 04 › 02 › an-introduction-to-database-migrations
A Gentle Introduction to Database Migrations in Prisma with Visuals | Wasp
April 2, 2025 - As you can see, migrations are something we do as we change our database's data schema. They updated your local database to have the tables that match your current Prisma models. At first, it might sound like needless bureaucracy for something that you could have done manually with some GUI and clicked around to set up the tables you need. What if you need to have the same table structure in multiple databases (e.g. staging and production environments)?
🌐
RedwoodJS Community
community.redwoodjs.com › get involved
Prisma Migrations Not Applying in Production - Get Involved - RedwoodJS Community
September 14, 2024 - Hello I am facing an issue with my Prisma migrations in RedwoodJS. 🙃 Everything works perfectly in my local environment; but when I deploy to production; the database schema doesn’t seem to update as expected. I’ve checked my environment variables and tried different deployment methods, ...
Top answer
1 of 4
19

They serve two different environments. The prisma db push is not to be used in your production environment, as stated in the docs

db push uses the same engine as Prisma Migrate to synchronize your Prisma schema with your database schema, and is best suited for schema prototyping. The db push command:

  1. Introspects the database to infer and executes the changes required to make your database schema reflect the state of your Prisma schema.

  2. By default, after changes have been applied to the database schema, generators are triggered (for example, Prisma Client). You do not need to manually invoke prisma generate.

  3. If db push anticipates that the changes could result in data loss, it will:

  • Throw an error
  • Require the --accept-data-loss option if you still want to make the changes

Note: db push does not interact with or rely on migrations. The migrations table will not be updated, and no migration files will be generated.

The prisma migrate dev is used in you local environment, as explained in the docs

migrate dev is a development command and should never be used in a production environment.

This command:

  1. Replays the existing migration history in the shadow database in order to detect schema drift (edited or deleted migration file, or a manual changes to the database schema)
  2. Applies pending migrations to the shadow database (for example, new migrations created by colleagues)
  3. Generates a new migration from any changes you made to the Prisma schema before running migrate dev
  4. Applies all unapplied migrations to the development database and updates the _prisma_migrations table
  5. Triggers the generation of artifacts (for example, the Prisma Client)

The migrate dev command will prompt you to reset the database in the following scenarios:

  • Migration history conflicts caused by modified or missing migrations
  • The database schema has drifted away from the end-state of the migration history

If you have any other question regarding this, there is this comparison in the docs explaining when to use one or the other.

2 of 4
11
  • Prisma db push syncs (and formats) your prisma schema to that of your database schema.
  • While prisma migrate dev "command automatically generates SQL migration files (saved in /prisma/migrations) and applies them to the database".

The main difference between both is the generation of the migration files.

🌐
Prisma
prisma.io › home › getting started with prisma migrate › getting started with prisma migrate › getting started with prisma migrate
Getting started with Prisma Migrate | Prisma Documentation
Generating Prisma Client if you need to adjust client output or runtime behavior after migrations · Quickstart with Prisma Postgres if you want a managed Postgres setup for the fastest end-to-end workflow · Review pricing if you're evaluating Prisma Postgres or managed workflows for production use
🌐
Prisma
prisma.io › home › overview of prisma migrate › overview of prisma migrate
Prisma Migrate: Database, Schema, SQL Migration Tool | Prisma Documentation
Prisma Migrate generates a history of .sql migration files, and plays a role in both development and production.
🌐
Medium
medium.com › @s.klop › introduction-to-prisma-migrations-and-database-management-with-prisma-part-8-15-6829a56dda70
Introduction to Prisma: Migrations and Database Management with Prisma — Part 8/13 | by Stephen Klop | Medium
January 31, 2024 - Development: Migrations are automatically applied to your development database. Production: Use npx prisma migrate deploy for safe migration application in production environments.
🌐
Answer Overflow
answeroverflow.com › m › 1387397993484779540
Changes to the schema on production - Prisma
June 25, 2025 - Alright, so i deployed but no i have to adapt. Still in testing so better get used to how prisma pushes new segments to postgres tables. Case 1 i change a default from false to true Its asking yo reset which we cant do anymore. Trying the prisma migrate --create-only, prisma migrate deploy ...
🌐
DEV Community
dev.to › whoffagents › prisma-migrations-in-production-zero-downtime-deployments-with-expand-contract-2l1p
Prisma Migrations in Production: Zero-Downtime Deployments With Expand-Contract - DEV Community
April 9, 2026 - # See which migrations have run npx prisma migrate status # In production, run via environment variable DATABASE_URL=$PROD_DATABASE_URL npx prisma migrate status
🌐
PlanetScale
planetscale.com › guides › frameworks and orms › prisma › automatic prisma migrations
Automatic Prisma migrations - PlanetScale
2 weeks ago - Prisma migrations follow the PlanetScale non-blocking schema change workflow. First, the schema is applied to a development branch and then the development branch is merged into the main production database.