misleading message during prisma migrate dev --create-only
See original GitHub issueBug description
when I change the column name and run npx prisma migrate dev --create-only
the message shown in the console is that the data will be deleted, but its job is to only create a migration file
Environment & setup
- OS:
- Database:
- Node.js version:
- OS: Windows 10
- Database: PostgreSQL
- Node.js version: 14.16.1
Prisma Version
2.23.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Migration troubleshooting in development - Prisma
This guide describes how to resolve issues with Prisma Migrate in a development environment, which often involves resetting your database.
Read more >Command Line Interface | RedwoodJS Docs
Prisma Migrate lets you use Prisma schema to make changes to your database declaratively, all while keeping things deterministic and fully customizable by ......
Read more >Prisma 2.19.0 Release - GitClear
Besides making Prisma Migrate ready for production in this release, it comes with a number of smaller fixes and improvements: After migrate dev...
Read more >How To Build a REST API with Prisma and PostgreSQL
You can also customize the generated SQL migration file if you add the --create-only option to the prisma migrate dev command; for example, ......
Read more >How To Use Prisma with PostgreSQL, SQLite, and MySQL 2022
The Prisma migrate tool takes the models defined in the schema file ... prisma migrate dev --name user-entity --create-only && npx prisma ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sairaj2119 👋
The message is indeed misleading as
prisa migrate dev --create-only
doesn’t delete data from the database.@pantharshit00 To reproduce:
Run migrate:
prisma migrate dev
Seed some sample data
Update the model
Run
prisma migrate dev --create-only
. You will get a warning in the terminal that data will be lost. Pressy
to confirm.Check the database and data still persists
The main issue here is we can change the messaging for
--create-only
as data is not lost when just creating the migration.We should change the message, but the warnings are still applicable because it’s what is going to happen when you later apply the migration that was created.