`npx prisma migrate dev --create-only` actually resets database
See original GitHub issueIt tells you it will do it:
...
√ Drift detected: Your database schema is not in sync with your migration history.
[+] Added tables
- Buyer
- BuyerGroup
[*] Changed the `Buyer` table
[+] Added foreign key on columns (buyerGroupId)
We need to reset the PostgreSQL database "emerald_jellyfish" at "pg-db-provision.cm0mkpwj8arx.eu-central-1.rds.amazonaws.com:5432".
Do you want to continue? All data will be lost. ... yes
...
But in the end it is still surprising that a command that is supposed to only create a migration (file), modifies the database.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Prisma Migrate | Database, Schema, SQL Migration Tool
Prisma Migrate is a database migration tool available via the Prisma CLI that integrates with Prisma schema for data modeling.
Read more >migrate dev --create-only doesn't work in the first time on an ...
As part of adding Prisma Migrate to your development environment, you must reset your development database. This will result in data loss in...
Read more >Effortless database schema migration with Prisma
Learn how to use Prisma Migrate to perform database schema migrations, reducing the tedium (and improving the performance) of your code.
Read more >Make a change to the database with Prisma.js without having ...
Resetting drops and recreates the database, which results in data loss. The database is reset when: You call prisma migrate reset explicitly ...
Read more >It's Prisma Time - Migrations - DEV Community
Prisma Migrate is an imperative database schema migration tool that ... npx prisma migrate dev --name rename_author_columns --create-only.
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
One more issue to file into “works as intended, but counter-intuitive”.
I can’t test the diffing tool anymore but will do on the next occasion I have.
What’s weird is, once the migration file was created,
npx prisma migrate deploy
had no issue applying the migration without resetting the (production) database. It really only wanted to reset the database to create the migration file. I chose to say ok for the reset using the development database, for which I have reset/repopulate scripts.