model Product {
id String @id @default(uuid())
storeId String
store Store @relation("StoreToProduct", fields: [storeId], references: [id])
categoryId String
category Category @relation("CategoryToProduct", fields: [categoryId], references:[id])
name String
price Decimal
sizeId String
size Size @relation(fields: [sizeId], references: [id])
colorId String
color Color @relation(fields: [colorId], references: [id])
images Image[]
saleItems SaleItem[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@index([storeId])
@@index([categoryId])
@@index([sizeId])
@@index([colorId])
}
I am building a NextJS App with Prisma, and I have the above Prisma model that I would like to make the sizeId and the colorId as optional items for the Product form, and I do not know how to do it with Prisma(Some say it is not possible).
Thanks in advance.