children and favourite child (ambiguous relation)
I want to model a relationship where a parent record can have many children but there is also a 'favourite' (or 'current favourite') child out of the list of children indicated by an id reference in the parent, to the child. I realise that this is a bit of a circular relationship and care will need to be taken when removing children or changing the favourite but I think the efficiency in query performance is worth the effort. Here is a contrived example...
This according to my brain should be fine but Prisma complains
I have tried a number of iterations of this including naming the relations and adding back references etc, all of which just introduce even more validation issues.
Any Ideas how I can make Prisma happy with this approach?
1 Reply
ok, never mind I figured it out. I want to apologise to anybody who is triggered by this example. I know these type of relationships can be fraught and vexxed. I only seek to understand.