prisma1-upgrade
prisma1-upgrade copied to clipboard
Error Syntax Error: Expected ":", found "(".
When I'm running the npx prisma-upgrade
command I'm getting the following error:
Error Syntax Error: Expected ":", found "(".
I've already created the schema.prisma with the npx prisma init
, and run the npx prisma introspect
, but when I run the npx prisma-upgrade
pointing the origina prisma1 yaml configuration, and the newly generated prisma.schema, it just fails with the above error.
Any idea?
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 yourschema.prisma
file - rename your old
datamodel.graphql
todatamodel.prisma
- update datamodel property of
prisma.yml
todatamodel: datamodel.prisma
- now run
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.