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. Answer from die-maus on reddit.com
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
node.js - Make a change to the database with Prisma.js without having to reset the whole thing - Stack Overflow
How can make a change to the database with Prisma.js without having to reset the whole thing? if I have used this command npx prisma migrate dev --name role-makeOptional-NormalizedName I will lose... More on stackoverflow.com
🌐 stackoverflow.com
prisma migrate dev - data lost
Hi. I am trying to migrate my updated schema to my database. But when I do I get the question: We need to reset the MySQL database... All data will be lost How can I migrate without losing all my data? PrismaJoinThe official Discord server of Prisma! More on answeroverflow.com
🌐 answeroverflow.com
October 17, 2024
node.js - PRISMA.IO - Erasing data when migrate prod database - Stack Overflow
I'm pretty sure the answer will ... with a sqlite database. Each time I run the command "npx prisma db push" all my data are erased. And I can't find a solution to migrate my production database without resetting the data ?... More on stackoverflow.com
🌐 stackoverflow.com
🌐
Medium
medium.com › israeli-tech-radar › prisma-orm-are-you-seriously-offering-to-reset-my-production-db-really-aa99756099e2
Prisma ORM: Are You Seriously Suggesting I Reset My Production DB?! | by Nir Alfasi | Israeli Tech Radar | Medium
June 29, 2025 - Prisma ORM: Are You Seriously Suggesting I Reset My Production DB?! If you want to learn how to recover your DB after hitting a schema drift issue or any other scenario where Prisma threatens to …
🌐
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
Find elsewhere
🌐
Medium
medium.com › @ayiaware › how-to-reset-your-postgresql-database-using-prisma-in-early-development-b36831b0f32b
How to Reset Your PostgreSQL Database Using Prisma in Early Development | by Daniel Ayia | Medium
September 14, 2025 - Reset the database to match the current schema. To simplify the reset process, you can create a custom script: "reset-db": "rm -rf prisma/migrations && npx prisma migrate dev --name init && npx prisma migrate reset --force"
🌐
Answer Overflow
answeroverflow.com › m › 1296448016353595472
prisma migrate dev - data lost
October 17, 2024 - Hi. I am trying to migrate my updated schema to my database. But when I do I get the question: We need to reset the MySQL database... All data will be lost How can I migrate without losing all my data? PrismaJoinThe official Discord server of Prisma!
🌐
GitHub
github.com › prisma › prisma › discussions › 23042
I need to reset my DB because my migrations are unhappy. Will I lose my authentication though? · prisma/prisma · Discussion #23042
Resetting the database will wipe out all the data, including your authentication data. If you have a seed file you've confirmed is working, you can use it to repopulate your database after the reset.
Author   prisma
🌐
GitHub
github.com › prisma › prisma › discussions › 19185
`prisma migrate dev` prompts me to reset my database, but I just baselined. · prisma/prisma · Discussion #19185
We need to reset the MySQL database "db_name" at "db_host:3306" Do you want to continue? All data will be lost. » (y/N) ... Confirmed the user has the correct permissions. Setting up an explicit shadow db connection url (didn't seem to make any difference). Change line endings on the init migration file before running npx prisma migrate resolve --applied 0_init (I am on a Windows and I thought maybe line endings was messing up the hash when appliying the migration or something)
Author   prisma
🌐
Dani Lucaci
danilucaci.com › blog › reset-and-seed-prisma-database
How to reset and seed a prisma.io database
July 26, 2019 - Step-by-step guide on how to reset and seed a Prisma database using data stored on a separate file.
🌐
Prisma
prisma.io › home › migration histories › migration histories › migration histories › migration histories
About migration histories | Prisma Documentation
Run prisma migrate reset - Prisma Migrate resets the database and replays all migrations, including the migration you edited.
🌐
Prisma
prisma.io › home › troubleshooting › troubleshooting › troubleshooting › troubleshooting
Troubleshooting | Prisma Documentation
If you introduced a SQL syntax error by manually editing the database, update the migration.sql file that failed and reset the database: ... If you introduced a change in the Prisma schema that cannot be applied to a database with data (for example, a mandatory column in a table with data):
🌐
Prisma
prisma.io › home › prisma cli reference › prisma cli reference › prisma cli reference
Prisma CLI reference | Prisma Documentation
Drops the database/schema if possible, or performs a soft reset if the environment does not allow deleting databases/schemas · Creates a new database/schema with the same name if the database/schema was dropped ... This command is not supported on MongoDB. Use db push instead. ... Prisma ORM includes built-in safety checks to prevent accidental destructive commands when run through AI coding assistants.
🌐
Stack Overflow
stackoverflow.com › questions › 73292180 › prisma-io-erasing-data-when-migrate-prod-database
node.js - PRISMA.IO - Erasing data when migrate prod database - Stack Overflow
I'm pretty sure the answer will ... with a sqlite database. Each time I run the command "npx prisma db push" all my data are erased. And I can't find a solution to migrate my production database without resetting the data ?...
🌐
Border States
borderstates.com › login
Login | Border States
Please note that change of context may affect the pricing and availability of the existing items in the cart · Your user session expired after 120 minutes of inactivity
🌐
Fig
fig.io › manual › prisma › migrate › reset
prisma migrate reset | Fig
Reset your database and apply all migrations, all data will be lost
🌐
GitHub
github.com › prisma › prisma › issues › 21483
Configuration to disallow database reset · Issue #21483 · prisma/prisma
October 13, 2023 - Some configuration on the connection or something should exist to prevent this behaviour. If in the datasource there's a preserveDB or preventDBReset or something like it, prisma should never suggest to reset db when running any command besides prisma reset db and even then it should ask more then once if we are sure of the concequences.
Author   prisma
🌐
Supabase
supabase.com › docs › guides › database › overview
Database | Supabase Docs
1 day ago - This database is the foundation that Auth, Storage, Realtime, and Edge Functions are built on, and Supabase manages daily database backups and offers point-in-time recovery on paid plans.