Hello, I'm developing an application where there will be an option to add friends, it's very simple, it's not social network, but you have to add a friend. I have the user table. Which tables and which relationships do I have to create to add friends? If someone sends you a simpler example that works, show which tables, and which fields, and which relationships one needs. Thanks
I found an example, I think it solves my situation:
1) John makes a request of friendship for Mary - requestorId = id of Joao - targetId = id of Maria - Create record in REQUISITION table (requestorId, targetId)
2) List the requests sent to Maria on her page - Find all records in the REQUISITION table when the targetId is equal to the id of Maria - For each record put a message of the type (Joao wants to be your friend - Accept or not)
3) Mary refuses - Deletes the record from the REQUISITION table.
4) Mary accepts - Create record in FRIENDSHIP table (idJoao, idMaria) - Deletes the record from the REQUISITION table.
But how would the types of relationships be, which way?