Harsha MV
09/21/2021, 11:29 AMmodel ProjectCategories {
project Project @relation(fields: [projectId], references: [id])
projectId String // relation scalar field (used in the `@relation` attribute above)
category Category @relation(fields: [categoryId], references: [id])
categoryId String // relation scalar field (used in the `@relation` attribute above)
@@id([projectId, categoryId])
}
Ryan
09/21/2021, 11:31 AMRyan
09/21/2021, 11:32 AM@db.Uuid
to the projectId
here as well.Harsha MV
09/21/2021, 11:32 AMHarsha MV
09/21/2021, 11:33 AMRyan
09/21/2021, 11:36 AMHarsha MV
09/21/2021, 11:50 AMHarsha MV
09/21/2021, 11:50 AMconst project = await prisma.project.findFirst({
where: {
username: {
equals: slug,
},
},
include: {
categories: { include: { category: true } },
},
});
Harsha MV
09/21/2021, 11:50 AMHarsha MV
09/21/2021, 11:51 AMRyan
09/21/2021, 11:54 AMHarsha MV
09/21/2021, 12:02 PMHarsha MV
09/21/2021, 12:07 PM