Sean Doughty
06/30/2021, 4:11 AMmodel Circle {
id Int @id @default(autoincrement())
name String
shape Shape?
}
model Square {
id Int @id @default(autoincrement())
name String
shape Shape?
}
model Shape {
id Int @id @default(autoincrement())
type String
typeId Int
circle Circle? @relation(fields: [typeId], references: [id])
square Square? @relation(fields: [typeId], references: [id])
}
I think what I am looking for is "optional" relationjanpio
janpio
Sean Doughty
07/01/2021, 6:13 AM