s1w
03/22/2022, 7:16 AMmodel Item {
id String @unique
}
model Set {
additions Item[]
removals Item[]
}
I can’t get the right combination of references and stuff between the twoNurul
03/22/2022, 7:29 AMmodel Item {
id String @id @default(uuid())
additionSet Set? @relation(name: "ADDITION_SET", fields: [additionSetId], references: [id])
additionSetId String?
removalSet Set? @relation(name: "REMOVAL_SET", fields: [removalSetId], references: [id])
removalSetId String?
}
model Set {
id String @id @default(uuid())
additions Item[] @relation("ADDITION_SET")
removals Item[] @relation("REMOVAL_SET")
}
Can you have a look at this schema and see if it solves it for you?
You probably are looking for Disambiguating Relationss1w
03/22/2022, 7:36 AMSet?
to Set[]
and after removing fields:
it seems to work, thanks!Nurul
03/22/2022, 7:39 AMs1w
03/22/2022, 7:40 AMOrcioly Andrade Alves
03/22/2022, 1:16 PMNurul
03/22/2022, 1:36 PMOrcioly Andrade Alves
03/22/2022, 1:41 PM