Natalia
Joey
03/01/2021, 7:12 PMProduct
and Category
model which are linked as below;
model Category {
id Int @id
name String
products Product[] @relation(references: [id])
image String?
}
model Product {
id Int @id
name String
price Float
image String
brand String
categories Category[] @relation(references: [id])
currentInventory Int
description String
}
Joey
03/01/2021, 7:13 PM_import_ { Category, Product } _from_ "@Prisma/client"
Joey
03/01/2021, 7:15 PMinclude
options which includes product in category and vice versa. My questions is, does Prisma generate this type or how do I achieve type safety fro this kind of queries?Joey
03/01/2021, 7:17 PMconst categories = await prismaClient.category.findMany({
include: {
products: true,
},
});
Joey
03/01/2021, 7:21 PMinterface inventoryDataType extends Product {
categories: Category[]
}
Gezim
03/01/2021, 10:00 PM*GetPayload
method to get types for my models. I’m having an issue with a many-to-many prop: https://github.com/prisma/prisma/discussions/5927Nothing.
03/02/2021, 11:23 AMconst update = await prisma.categories.update({
where: {
id: req.params.id
},
data:{
status: "disabled"
}
});
I would have sent the error here but my PC is off RN.
I'm new to Prisma and I'm not sure whether I'm doing anything wrong here, please help!Alex Reyne
03/02/2021, 12:53 PMKyle Hayes
03/02/2021, 5:13 PMRene Osman
03/02/2021, 8:39 PMglenn
03/03/2021, 2:38 AMdeleteMany: {
sj
03/03/2021, 5:03 AMJulien Goux
03/03/2021, 11:26 AMJulien Goux
03/03/2021, 11:27 AMJulien Goux
03/03/2021, 11:27 AMJulien Goux
03/03/2021, 11:29 AMVille
03/03/2021, 2:22 PMNatalia
manuel
03/03/2021, 5:49 PMmanuel
03/03/2021, 5:54 PMJosef Henryson
03/04/2021, 7:33 AMVladi Stevanovic
James Irving-Swift
03/04/2021, 11:24 AMNothing.
03/04/2021, 3:13 PMRashmi Bidanta
03/04/2021, 3:38 PMid
column.
org.postgresql.util.PSQLException: ERROR: column "id" of relation "_Table1ToTable2" does not exist
any help in this regard would be highly appreciatedJulien Goux
03/04/2021, 3:41 PMJulien Goux
03/04/2021, 3:41 PMJulien Goux
03/04/2021, 3:42 PM