Prisma Migrate dev --create-only resets my DB!

jack@dance-party Wanyama % npx prisma migrate dev --name "add_other_to_win_state" --create-only

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "wanyama" at "eu01.jpy.gg:3307"

Drift detected: Your database schema is not in sync with your migration history.

The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database.

It should be understood as the set of changes to get from the expected schema to the actual schema.

[*] Changed the `Case` table
[*] Altered column `win_state` (type changed)

✔ We need to reset the MySQL database "wanyama" at "eu01.jpy.gg:3307"
Do you want to continue? All data will be lost. … yes

Applying migration `20250219144234_init`
Applying migration `20250301005536_add_embeds_table`
Applying migration `20250308014453_add_client_and_case_models`
Applying migration `20250308140356_client_id_changes`
Applying migration `20250308153731_remove_dob_add_id_card`
Applying migration `20250308221736_remove_summary_from_case`
Applying migration `20250309021721_add_channel_id_to_case`
Applying migration `20250309153648_add_win_state_and_archived_to_case`

The following migration(s) have been applied:

migrations/
└─ 20250219144234_init/
└─ migration.sql
└─ 20250301005536_add_embeds_table/
└─ migration.sql
└─ 20250308014453_add_client_and_case_models/
└─ migration.sql
└─ 20250308140356_client_id_changes/
└─ migration.sql
└─ 20250308153731_remove_dob_add_id_card/
└─ migration.sql
└─ 20250308221736_remove_summary_from_case/
└─ migration.sql
└─ 20250309021721_add_channel_id_to_case/
└─ migration.sql
└─ 20250309153648_add_win_state_and_archived_to_case/
└─ migration.sql
Prisma Migrate created the following migration without applying it 20250310183637_add_other_to_win_state

You can now edit it and apply it by running prisma migrate dev.
jack@dance-party Wanyama %
jack@dance-party Wanyama % npx prisma migrate dev --name "add_other_to_win_state" --create-only

Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": MySQL database "wanyama" at "eu01.jpy.gg:3307"

Drift detected: Your database schema is not in sync with your migration history.

The following is a summary of the differences between the expected database schema given your migrations files, and the actual schema of the database.

It should be understood as the set of changes to get from the expected schema to the actual schema.

[*] Changed the `Case` table
[*] Altered column `win_state` (type changed)

✔ We need to reset the MySQL database "wanyama" at "eu01.jpy.gg:3307"
Do you want to continue? All data will be lost. … yes

Applying migration `20250219144234_init`
Applying migration `20250301005536_add_embeds_table`
Applying migration `20250308014453_add_client_and_case_models`
Applying migration `20250308140356_client_id_changes`
Applying migration `20250308153731_remove_dob_add_id_card`
Applying migration `20250308221736_remove_summary_from_case`
Applying migration `20250309021721_add_channel_id_to_case`
Applying migration `20250309153648_add_win_state_and_archived_to_case`

The following migration(s) have been applied:

migrations/
└─ 20250219144234_init/
└─ migration.sql
└─ 20250301005536_add_embeds_table/
└─ migration.sql
└─ 20250308014453_add_client_and_case_models/
└─ migration.sql
└─ 20250308140356_client_id_changes/
└─ migration.sql
└─ 20250308153731_remove_dob_add_id_card/
└─ migration.sql
└─ 20250308221736_remove_summary_from_case/
└─ migration.sql
└─ 20250309021721_add_channel_id_to_case/
└─ migration.sql
└─ 20250309153648_add_win_state_and_archived_to_case/
└─ migration.sql
Prisma Migrate created the following migration without applying it 20250310183637_add_other_to_win_state

You can now edit it and apply it by running prisma migrate dev.
jack@dance-party Wanyama %
Notice how I used --create-only, it actually reset my entire prod DB! I had a backup, dw.
3 Replies
Prisma AI Help
You chose to debug with a human. They'll tinker with your query soon. If you get curious meanwhile, hop into #ask-ai for a quick spin!
Nurul
Nurul4d ago
Hey @Jack 👋 The reset prompt will be removed with the new prisma version releasing today. Do you know what was causing the drift?
js.jack
js.jackOP4d ago
I may or may not have accidentally done npx prisma db push in production... :kekw: I've setup a totally separate dev environment now so I can properly use the different between migrate dev and migrate deploy

Did you find this page helpful?