model Post {
id Int @id @default(autoincrement())
title String
postCategories PostCategories[]
}
model PostCategories {
post Post @relation(fields: [postId], references: [id])
postId Int
category Category @relation(fields: [categoryId], references: [id])
categoryId Int
@@id([postId, categoryId])
}
model Category {
id Int @id @default(autoincrement())
name String
postCategories PostCategories[]
}
This get an error when I generate on prisma 7.
Unsupported ID type: VariantOptionValue on model OptionValue in relation variants.
My tables give me the same error as the exemple.
model VariantOptionValue {
variantId String
variant ProductVariant @relation(fields: [variantId], references: [id], onDelete: Cascade)
optionValueId String
optionValue OptionValue @relation(fields: [optionValueId], references: [id], onDelete: Cascade)
@@id([variantId, optionValueId])
}
Both tables have the according relation.
options VariantOptionValue[]
And
variants VariantOptionValue[]