many to many self reference
I'm trying to define "follows" & "followers" relations on a user entity. Obviously this is a many to many relation, but how to I define both "edges" in my relation?
I've seen
many
takes a config param relationName
but I don't see where I can define that the relation "follows" references followsUserId
and "followers" references userId
?5 Replies
any updates here? I've been trying to do soemthing like this too
See this example of how this can be achieved: https://discord.com/channels/1043890932593987624/1111572543556550738/1148828114345021510
still having issues 😢, pd: I can't use
references
because I'm using planetscale
@Angelelz these are my relations and tables
not sure if the friendships/followers is conflicting with the other relationsPlease read this thread, I go over a lot of details there with that person: https://discord.com/channels/1043890932593987624/1111572543556550738
In particular, pay attention to the relationName, it's kind of important
BTW, you don't really need the refereces to make them work with drizzle
I don't use planetscale because I want my referential integrity, but it'll work
ah found the issue, it was about the relationName, thanks a lot!