Harun
09/27/2021, 6:49 AMLukáš Stuchlík
09/27/2021, 6:59 AMHarun
09/27/2021, 7:05 AMError parsing attribute "@relation": The relation fields `warehouse` on Model `AccountAddress` and `address` on Model `Warehouse` both provide the `references` argument in the @relation attribute. You have to provide it only on one of the two fields.
Lukáš Stuchlík
09/27/2021, 7:06 AM@relation
on both sides - just need to put it on one of the sides
model A {
id Int @id
bId Int
bEntity B @relation(fields: [bId], references: [id])
}
model B {
id Int @id
aEntity A
}
something like this should work - entity A is the one holding the foreign key, but the connection should be available on both sidesHarun
09/27/2021, 7:07 AMHarun
09/27/2021, 7:09 AMmodel B {
aEntity A?
}
Lukáš Stuchlík
09/27/2021, 7:10 AMHarun
09/27/2021, 7:10 AMRyan
09/27/2021, 8:02 AMLukáš Stuchlík
09/27/2021, 8:05 AMHarun
09/27/2021, 11:05 AMHarun
09/27/2021, 11:05 AM