“Property does not exist” when I want to use model added in Prisma.schema
I tried prisma generate and prisma migrate dev but was still having the same error. I had to restart VSCode and everything is working fine now
I tried prisma generate and prisma migrate dev but was still having the same error. I had to restart VSCode and everything is working fine now
You can access the user_type enum in your application code like this: import {user_type } from “@prisma/client”; let foo: user_type = “superadmin”; // use like any other type/enum How you plan to connect this to the client-side or send it there is up to you. Typically Prisma types reside in the server-side of your code, … Read more
The fields in where need to be unique. If you can make some field, let’s say date @unique (date: DateTime! @unique), and use that for your where in the upsert, I think it would work (tested on my local)
An alternate method (my preferrence) to get the “full” type, or the model with all of its possible relations, is to use the GetPayload version of your model type. The type is a generic that can receive the same object you pass to your query. import { PrismaClient, Prisma } from “@prisma/client”; const prisma = … Read more
If anybody running into this issue, just run npx prisma generate. This will re-establish the link between schema.prisma and .env file.
You can use the in operator to query by multiple id inside findMany. Example: const ret = await prisma.signe.findMany({ where: { id: { in: [1, 2, 12] }, } }) More details are available in the prisma client reference.