Open darkmavis1980 opened 3 years ago
I got same issue if anyone know how to prevent this issue
same here
Got it working 👏
I believe the old datamodel file needs to be rename and still contain the old Prisma1 schema. So the upgrade CLI can see incompatibilities, the old schema will be compared with the new schema.
Here are the steps I took:
npx introspect
will give you a new Prisma2 schema in your schema.prisma
filedatamodel.graphql
to datamodel.prisma
prisma.yml
to datamodel: datamodel.prisma
npx prisma-upgrade
I was experiencing this issue when upgrading from 1 > 4. I did not find a fix, instead I decided to upgrade from 1 > 3 and then 3 > 4. This advice may save you many headaches. Good luck!
Can you share the exact versino of Prisma 3 you were using @julianwagle? It seems this is generally caused by new Prisma schema syntax we introduced along the way, so the safe option might even be to use a Prisma 2.x for the initial update and then go to 3 and 4 - but if you found a working version of 3.x this might indeed work for others as well.
When I'm running the
npx prisma-upgrade
command I'm getting the following error:I've already created the schema.prisma with the
npx prisma init
, and run thenpx prisma introspect
, but when I run thenpx prisma-upgrade
pointing the origina prisma1 yaml configuration, and the newly generated prisma.schema, it just fails with the above error.Any idea?