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.

Answer from Daniel Olavio Ferreira on Stack Overflow
🌐
Prisma
prisma.io › home › overview of prisma migrate › overview of prisma migrate
Prisma Migrate: Database, Schema, SQL Migration Tool | Prisma Documentation
Prisma Migrate is a database migration tool available via the Prisma CLI that integrates with Prisma schema for data modeling.
🌐
Prisma
prisma.io › migrate
Prisma Migrate | Database Migrations for Prisma ORM
Prisma Migrate generates migrations based on changes in the Prisma schema – a human-readable declarative definition of your database schema.
Discussions

How do I use Prisma without having to wipe my database all the time?
Think of it like this: You have a table with some users, none of which have a last name. Now you update schema.prisma with a required column called lastName, without a default value. How should Prisma handle the migration for you? Since Prisma can't guess the last name of every user, the only reasonable thing it can do is to ask you to recreate the data—which means resetting that table. To work around that, you need two migrations. You first set the column's default value to a placeholder—ensuring every row has a value. You then make a second migration where you remove the default value. This is, of course, just one of many reasons for why Prisma would want to reset a table, or sometimes even the whole database (if the effect is large enough). Prisma migrations are great, and they make life so much easier! But you still need to consider how they are applied and design your database accordingly: Prisma won't be able to magically solve the logical impossibilities that may occur otherwise. So, just like with everything else in programming, you need to be careful and considerate, and the more you practice; the easier it gets. I think Prisma sometimes overpromises on "making database design easy". It sure makes it easier, but you still need to think about what's going on behind the scenes. The way it abstracts the database design behind a neat little schema—together with its automatic migrations—can sometimes make you miss the forest for all the trees. More on reddit.com
🌐 r/node
39
34
December 5, 2023
how to generate a migration file with prisma - Stack Overflow
I tried this in the repository's prisma folder npx prisma migrate dev --name add_finance_tables but it shows this in the terminal ** Environment variables loaded from .env Prisma schema loaded from More on stackoverflow.com
🌐 stackoverflow.com
When should you consider not using "prisma migrate"?
We did exactly this before moving from Prisma to a different system (we're Go, so sqlc + atlas). Atlas has been rock-solid for us -- we also don't use the HCL syntax, Atlas is just one of the better migration systems I've used. We did a writeup on this here: https://docs.hatchet.run/blog/migrating-off-prisma More on reddit.com
🌐 r/node
10
21
November 27, 2024
Where do you actually run prisma migrate deploy?
If you want an easy way to develop, I can recommend Planetscale which has a very generous free tier. It's a mysql db service that has branches like your code. That means you can develop code locally, run prisma db push and then merge the dev branch of your db into prod when you want. More on reddit.com
🌐 r/node
18
4
December 11, 2022
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.

🌐
GitHub
github.com › prisma › prisma › discussions › 24571
How should migration be done to Production? · prisma/prisma · Discussion #24571
In your development environment, you use prisma migrate dev --create-only to create a migration file without applying it. This command generates the migration.sql file based on the changes in your schema.prisma.
Author   prisma
🌐
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 - Once you've written a Prisma schema for your app, you'll need to create a migration file. This file will contain SQL commands needed to update your database, such as creating new tables or modifying existing ones, or adding database indexes, etc.
🌐
PlanetScale
planetscale.com › guides › frameworks and orms › prisma › automatic prisma migrations
Automatic Prisma migrations - PlanetScale
1 week ago - This is different from the typical Prisma workflow which uses prisma migrate in order to generate SQL migrations for you based on changes in your Prisma schema. When using PlanetScale with Prisma, the responsibility of applying the changes is on the PlanetScale side.
Find elsewhere
🌐
Reddit
reddit.com › r/node › how do i use prisma without having to wipe my database all the time?
r/node on Reddit: How do I use Prisma without having to wipe my database all the time?
December 5, 2023 -

I'm using Prisma for a large project I've been working on for the past few months, and I still don't understand the flow of it. At first I was migrating every time I made a change to my schema, and constantly getting the "All data will be lost" prompt. Since then I've learned to use `db push` while developing and then migrate when a feature is finished, but it's still constantly making me reset my database.

Right now I'm using the same db for dev and staging (because I don't want to pay for 2 different ones) but I'd imagine this would still be an issue if I had separate databases. What do I need to do to stop being forced to reset my db? Or, at least, how would I migrate my development db to mirror my production db without it being wiped?

As you can probably tell, this is my first time working with Prisma (or any ORM, in depth) so this might be a stupid question, but I can't find much online besides general tutorials. Any help would be greatly appreciated!

Top answer
1 of 5
23
Think of it like this: You have a table with some users, none of which have a last name. Now you update schema.prisma with a required column called lastName, without a default value. How should Prisma handle the migration for you? Since Prisma can't guess the last name of every user, the only reasonable thing it can do is to ask you to recreate the data—which means resetting that table. To work around that, you need two migrations. You first set the column's default value to a placeholder—ensuring every row has a value. You then make a second migration where you remove the default value. This is, of course, just one of many reasons for why Prisma would want to reset a table, or sometimes even the whole database (if the effect is large enough). Prisma migrations are great, and they make life so much easier! But you still need to consider how they are applied and design your database accordingly: Prisma won't be able to magically solve the logical impossibilities that may occur otherwise. So, just like with everything else in programming, you need to be careful and considerate, and the more you practice; the easier it gets. I think Prisma sometimes overpromises on "making database design easy". It sure makes it easier, but you still need to think about what's going on behind the scenes. The way it abstracts the database design behind a neat little schema—together with its automatic migrations—can sometimes make you miss the forest for all the trees.
2 of 5
19
bruh
🌐
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 - In this part, we focus on Prisma Migrate, a critical feature for managing changes in your database schema. Prisma Migrate simplifies the creation and implementation of database changes, proving essential for developers.
🌐
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.
🌐
GitHub
github.com › prisma › migrate
GitHub - prisma/migrate: Issues for Prisma Migrate are now tracked at prisma/prisma. This repo was used to track issues for Prisma Migrate Experimental and is now deprecated. · GitHub
Prisma Migrate is a powerful database schema migration tool. It uses a declarative data modeling syntax to describe your database schema.
Starred by 761 users
Forked by 20 users
Languages   TypeScript
🌐
Fig
fig.io › manual › prisma › migrate › dev
prisma migrate dev | Fig
The migrate dev command updates your database using migrations files during development
🌐
Prisma
prisma.io › home › migrate to prisma v7 › migrate to prisma v7 › migrate to prisma v7
Migrate to Prisma v7 | Prisma Documentation
Include this prompt in your AI agent to upgrade to Prisma ORM 7. GitHub Copilot: Type #<filename> to reference the prompt file. Cursor: Use @Files and select your prompt file. Zed: Use /file followed by your prompt's path. Windsurf: Use @Files and choose your prompt file from the list. ... --- # Specify the following for Cursor rules description: Guidelines for migrating an app to Prisma ORM v7 alwaysApply: false --- # Prisma v6 → v7 Migration Assistant **Role:** You are a precise, changeset-oriented code migration assistant.
🌐
Prisma
prisma.io › home › postgresql › postgresql › postgresql
Quickstart: Prisma ORM with PostgreSQL (10 min) | Prisma Documentation
import "dotenv/config"; import { defineConfig, env } from "prisma/config"; export default defineConfig({ schema: "prisma/schema.prisma", migrations: { path: "prisma/migrations", }, datasource: { url: env("DATABASE_URL"), }, });
🌐
Reddit
reddit.com › r/node › when should you consider not using "prisma migrate"?
r/node on Reddit: When should you consider not using "prisma migrate"?
November 27, 2024 -

Hey all

My name is Rotem, I'm one of the maintainers of atlasgo.io, a database schema-as-code tool, and the CTO of Ariga, the company maintaining it.

We recently published a guide about how to use Atlas with Prisma, essentially replacing the `prisma migrate` command.

Here's the guide

As far as ORMs go u/prisma probably has one of the best schema migration tools out there (`prisma migrate`).

It can automatically plan migrations for you, uses a shadow db to verify them, and has lots of utility subcommands to streamline development.

If you use Prisma, you should probably keep using it.

But there are some cases where you should consider looking at a specialized schema management tool.

Why?

ORMs typically ship with schema management tools.

Without a way to provision the DB schema, the ORM cannot operate, and so any ORM that wants users to have a half-decent experience needs to ship something.

ORMs exist to *abstract* the DB away and give a more or less equivalent experience across databases (e.g should work ~the same for PostgreSQL/MySQL/SQL Server/etc.

As an abstraction layer, they tend to focus on the common DB features (tables, indexes, FKs..)

Being an ORM maintainer myself (entgo.io), I can attest that as an ORM author, migrations are experienced as a "necessary evil", something I have to ship, but really is just an annoying requirement. ORMs exist to bridge code and DB - they are a runtime effort, not a CI/CD or resource management show.

--

So when should you consider using a specialized schema management tool like atlasgo.io?

  1. When you want to utilize more advanced features of your DB (view, stored procs, functions, mat views, RLS, ..) and want the same automatic planning experience for those resources.

  2. If you're a Platform Eng, and need to support a wide range of languages/frameworks in a standard way. Atlas has adapters/providers that read the schema from the ORM and provide a unified experience

  3. If you're a DevOps/Software Delivery focused eng, and want robust CI/CD machinery (k8s operator, terraform provider, github action, gitlab component, etc) and don't want to build all this stuff on your own.

--

TL;DR `prisma migrate` is awesome. You should probably keep using it, but if you relate to the use cases above, we would love for you to try our tool!

If you're interested, here's the link to the guide again:

https://atlasgo.io/guides/orms/prisma

Looking forward to your feedback!

-R

🌐
Prisma
prisma.io › home › understanding migrations › understanding migrations › understanding migrations › understanding migrations
A mental model for Prisma Migrate | Prisma Documentation
The prisma migrate dev command allows you to track the changes you make to your database. The prisma migrate dev command automatically generates SQL migration files (saved in /prisma/migrations) and applies them to the database.
🌐
npm
npmjs.com › package › @prisma › migrate
@prisma/migrate - npm
March 27, 2026 - Prisma Migrate is an imperative database schema migration tool that enables you to make changes to your database schema.
      » npm install @prisma/migrate
    
Published   Apr 22, 2026
Version   7.8.0
🌐
Reddit
reddit.com › r/node › where do you actually run prisma migrate deploy?
r/node on Reddit: Where do you actually run prisma migrate deploy?
December 11, 2022 -

I'm working on a little project with supabase and prisma, I've just been using one dev database which I update with prisma migrate dev. For production migrations, you're supposed to use prisma migrate deploy, which the prisma docs say to put in a CI/CD pipeline.

  • I don't have a CI/CD pipeline

  • I can't run it locally from my project directory, cause prisma uses the DATABASE_URL environment, which is pointing to my dev database

So I'm wondering where y'all would actually run prisma migrate deploy from? Should I just bite the bullet and learn some github actions? Or is there an easier way?

EDIT: The prisma docs recommend using dotenv-cli to use switch between .env files, but I'm kinda worried that I might fuck up somehow and end up running prisma migrate reset on my prod database, and delete everything. But, seems like that might be my plan until I figure out some CI/CD stuff.

Still definitely open to any advice though!

🌐
GitHub
github.com › prisma › prisma › discussions › 13160
How I can change data in prisma.schema, without losing data after migration? · prisma/prisma · Discussion #13160
May 5, 2022 - In a scenario where two different databases are being used, each with its schema (Schema A and Schema B), and there's a need to make changes to fields of a table in Schema B, the challenge arises when running the migration command: npx prisma migrate dev --schema prisma/schema2.prisma --name edit-form-datable --create-only
Author   prisma