Mark
10/19/2021, 1:18 PMnpx prisma format
it automatically added @unique
to some of our foreign key columns. Whilst this might be beneficial for some, this automatic addition of directive prohibits us from re-using our featured image across Recipes.Ryan
10/19/2021, 1:21 PMRyan
10/19/2021, 1:22 PMMark
10/19/2021, 1:27 PMmodel Recipe {
id String @id @default(cuid())
slug String @unique
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
featuredImage Image? @relation(fields: [featuredImageId], references: [id])
featuredImageId String?
}
model Image {
id String @id @default(cuid())
title String
altText String
mimeType String
url String
height Int
width Int
recipe Recipe?
}
Mark
10/19/2021, 1:27 PMRyan
10/19/2021, 1:59 PM