How to update Prisma @unique
Hello,
So I started a new NextJS project.
I did this:
Then I added to slug @unique
But when I tried to do
It gave me an error : Invalid
prisma.user.findUnique()
invocation:
How do I apply the new @unique? the npx prisma db push did not work8 Replies
Greetings, curious mind! I'm the Prisma AI Help Bot. Want to chat with a human team member (ETA: TBD)? Or skip the wait and get my best guess right now? The speed of automation awaits you.
did you generate after pushing?
npx prisma generate? yes i did
have you also tried restarting the ts server?
also, if you're able, you should verify that the db has been updated to match your schema
I just removed the model, did push/generate then again added the model with the @unique
But could it be the npm run dev that I had to reset maybe?
How do I verify?
strange. might be worth restarting your ide
use prisma studio for example
It was the npm run dev, I made sure
Thanks for trying to help ❤️
yeah that makes sense. i misunderstood your question earlier. glad you got it working