3
Hello, I am developing an application where there will be an option to add friends,is very simple, it is not social network, but have to add friend.
I have the user table.
What tables and relationships do I have to create to add friends?
If someone sends a simpler, working example, show which tables, which fields, and which relationships they need.
Thank you
I found an example,:
1) John makes a request for friendship for Mary - requestorId = id of Joao - targetId = id of Maria - Create record in REQUISICAO table (requestorId, targetId)
2) List the requests sent to Maria on her page - Fetch all records in the REQUISICAO table when targetId is equal to Maria’s id - For each record assemble a message of the type (Joao wants to be your friend - Accept or not)
3) Mary refuses to - Excludes the record from the REQUISICAO table.
4) Mary accepts - Create record in FRIENDSHIP table (idJoao, idMaria) - Excludes the record from the REQUISICAO table.
But what would the types of relationship look like, which?
the first sql block is to know , the list of friends? know all the friends of a certain user.
– War Lock
In case of rejection what would have to be made clear some value?
– War Lock
Thank you , thanks
– War Lock