"prisma migrate dev" on existing database

Viewed 32

im trying to setup prisma migrate on a database (mysql) already populated with data on my dev enviroment but so far i can't make it work.

1. I did prisma db pull to create the schema from it (works fine). When running prisma migrate dev --name initial-migration --create-only i get a warning asking to RESET the database... i dont want that. So...

2. Run this command prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script > migration.sql and manually move the sql file to a manually created prisma/migrations/init folder

3. Now i try to baseline that migration running prisma migrate resolve --applied "initial"

i get an error saying the migration cant be found.. but it's there and even prisma knows it.,..

console capture of the error

0 Answers
Related