I know this was a while ago but the fix is to first make a change in your schema.prisma file. Add whatever changes you need. Then run the command you are running. It will then notice the changes you made on the file and generate the SQL needed to achieve that change. Hope this helps.

Answer from Alexander on Stack Overflow
🌐
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
Review pricing if you're evaluating Prisma Postgres or managed workflows for production use ... Adding to a new projectCreate an initial migrationAdditional migrationsCommitting to versions controlAdding to an existing projectIntrospect to create or update your Prisma schemaCreate a baseline migrationWork around features not supported by Prisma Schema LanguageApply the initial migrationsCommit the migration history and Prisma schemaGoing furtherWhere to go next
Discussions

Prisma: how do you handle migrations + custom sql
I sure wish people who make migration tools that aren’t friendly to custom SQL would quit programming. If what you need is a single migration to efficiently create the schema in an empty database, could you just pg_dump the schema of a fully migrated database, and use that as your squashed migration? That’s basically what I do in my app, I don’t use Prisma though.  I have some special metadata tables that migrations insert stuff into, so I also dump the data from those into my squashed migrations. More on reddit.com
🌐 r/node
21
10
February 27, 2026
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
sql - How to add an empty migration in prisma? - Stack Overflow
I need to add an empty migration to write a SQL query and manipulate the data manually. There is no change in my schema and basically, I just need to apply this query to my existing data. ... Recommended way: Add --create-only to your command. prisma migrate dev --create-only --name ... More on stackoverflow.com
🌐 stackoverflow.com
A better Prisma down migration flow for development
Thanks, this really helped! More on reddit.com
🌐 r/prismaorm
2
15
October 5, 2024
🌐
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
🌐
Prisma
prisma.io › migrate
Prisma Migrate | Database Migrations for Prisma ORM
Prisma Migrate uses Prisma schema changes to automatically generate fully customizable database schema migrations ... Migrations are automatically generated so you don't have to write the SQL by hand.
🌐
Prisma
prisma.io › home › overview of prisma migrate › overview of prisma migrate
Prisma Migrate: Database, Schema, SQL Migration Tool | Prisma Documentation
Declarative: The data model is described in a declarative way in the Prisma schema. Prisma Migrate generates SQL migration files from that data model.
🌐
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.
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
🌐
PlanetScale
planetscale.com › guides › frameworks and orms › prisma › automatic prisma migrations
Automatic Prisma migrations - PlanetScale
2 weeks ago - Run npx prisma init inside of your project to create the initial files needed for Prisma. Install the PlanetScale CLI. ... Prisma migrations follow the PlanetScale non-blocking schema change workflow.
🌐
Medium
medium.com › @SahilSharma_SoftwareDeveloper › migrations-in-prisma-0a2f4e660e14
Migrations in Prisma. Migrations in Prisma are a systematic… | by Sahil Sharma | Medium
March 10, 2024 - Migrations in Prisma Migrations in Prisma are a systematic way to evolve your database schema over time in a version-controlled manner. They allow you to define incremental changes to your database …
🌐
LogRocket
blog.logrocket.com › home › effortless database schema migration with prisma
Effortless database schema migration with Prisma - LogRocket Blog
June 4, 2024 - However, Prisma provides mechanisms to make this process less daunting and risky than usual by using a specific feature called Prisma Migrate. With that covered, let’s set up a project and get into the meat of the article. First, head over to a suitable directory and run the following command in the terminal: ... The command above initializes the directory and creates a package.json file.
🌐
Prisma
prisma.io › home › dev › dev › dev
prisma migrate dev | Create & Apply Migrations | Prisma Documentation
Create and apply migrations during development with prisma migrate dev. Uses shadow database. Generates migration from schema changes.
🌐
Brendonovich
prisma.brendonovich.dev › extra › migrations
Migrations – Prisma Client Rust
When the CLI is available, use it manually or in CI to deploy migrations. While modifying your Prisma schema use PrismaClient::_db_push to synchronize your database and schema.
🌐
Codú
codu.co › home › niall maher › how to create prisma migrations
How to Create Prisma Migrations | by Niall Maher | Codú
February 25, 2024 - You would start by defining this new model in your Prisma schema file (prisma/schema.prisma): model UserProfile { id Int @id @default(autoincrement()) bio String? userId Int @unique user User @relation(fields: [userId], references: [id]) } After updating your schema, you apply these changes with the following command: ... It creates a new migration file in prisma/migrations that records your schema changes.
🌐
Prisma
prisma.io › dataguide › types › relational › what-are-database-migrations
Database Migrations: What are the Types of DB Migrations?
After the artifacts describing the desired state are created, the actual migration involves comparing the generated files against the current state of the database. This process allows the software to analyze the difference between the two states and generate a new file or files to bring the current database schema in line with the schema described by the files.
🌐
DEV Community
dev.to › playfulprogramming › its-prisma-time-migrations-7pk
It's Prisma Time - Migrations - DEV Community
February 2, 2022 - Prisma Migrate is an imperative database schema migration tool that enables you to: Keep your database schema in sync with your Prisma schema as it evolves and ... To see how it works, today we'll recreate all the schema used in this series, so let's started. Before creating our first migration, we need to create our schema, thus in the prisma/schema...
🌐
Prisma
prisma.io › home › expand-and-contract migrations › expand-and-contract migrations › expand-and-contract migrations
How to migrate data with Prisma ORM using the expand and contract pattern | Prisma Documentation
... generator client { provider ... @default(autoincrement()) title String content String? published Boolean @default(false) } Create a prisma.config.ts file in the root of your project with the following content:...