"All data will be lost" ???
I don't understand this message. I thought I am using
shadowDatabaseUrl
to test things and not kill my regular database accidentally with a migration. Does this mean prisma wants to delete my regular database? Or just the shadow one?
3 Replies
You opted for speed from this bot. Let's conjure up an answer right now!
The message "All data will be lost" refers to your regular development database, not just the shadow database. When you run
- The "All data will be lost" warning is about your main development database, not the shadow database. - If you confirm, your development database will be wiped. - The shadow database is managed automatically and is not the subject of this warning. If you want to avoid this in production, always use
prisma migrate dev
and Prisma detects issues like migration conflicts or schema drift, it may prompt you to reset the main database defined in your datasource
block. This reset will drop all tables and data in that database schema—not just the shadow database—if you confirm the prompt.
The shadow database is used internally by Prisma to check for drift and generate migrations, but the reset warning and data loss apply to your main development database, not the shadow one. The shadow database is created and dropped/reset as needed, but you are never prompted about its data loss—it’s only for internal migration checks and is not meant to hold any persistent data you care about. The warning is about your actual development database, so be careful when confirming this prompt, as it will delete all your data in that environment How the shadow database works prisma migration with plsql.
In summary:- The "All data will be lost" warning is about your main development database, not the shadow database. - If you confirm, your development database will be wiped. - The shadow database is managed automatically and is not the subject of this warning. If you want to avoid this in production, always use
prisma migrate deploy
, which never resets the database or causes data loss prisma migration with plsql.
✅ Great, thanks for letting us know that this solved your question!Still don't understand why there is no error message, which would help to understand the situation.
Why is there no verbose option to see what's happening?
Created an issue
https://github.com/prisma/prisma/issues/27227
GitHub
Migration failed, no detailed error is shown · Issue #27227 · pri...
Bug description Newbie, starting to use prisma. With my latest migration, prisma suddenly wants to delete all my data. % npx prisma migrate dev --name tenant Environment variables loaded from .env ...