Curious if anyone has gone through upgrading an ap...
# orm-help
c
Curious if anyone has gone through upgrading an application that was using the Prisma beta to Prisma 2 stable? Going through it right now and... there's a fun mix of v1 API's and v2.
e
I went through this a few months ago. Most of the syntax errors in my case could be found by running
yarn tsc
or
npx tsc
. I search + replace most of it 🙂
c
That's a good call out! The prior dev here was using
nexus-prisma-plugin
+ a few other things, so I'm basically trying down a bunch of shenanigans. For the most part it seems straight-forward (
first
replaced by
take
, though the I think the
findUnique
vs
findOne
might be a little different?)
e
I think
findOne
is just renamed in
findUnique
since 2.12 according to this announcement: https://prisma.slack.com/archives/C0MQJ62NL/p1606235903309700
If unsure, maybe you can add tests before making the changes 🙂
r
@chrisdhanaraj 👋 You can also use the codemods to update this in a single command as mentioned in the announcement 🙂
e
Nice one @Ryan! I knew I was forgetting something important! I used that codemod as well and it worked very well 🙌
💯 1
🙌 1
c
Ahhh a codemod! Perfect, I’ll give that a whirl and see what I missed Re: findOne vs findUnique - yeah my b, misremembered this! The prior dev had used a unique key like EntityType.someKey and that was throwing errors in the new version