+-----------------------------------+
| fID | personA | personB | fStatus |
|-----------------------------------|
| 1 | u1ID | u2ID | 1 |
| 2 | u3ID | u4ID | 0 |
| 3 | u1ID | u3ID | 1 |
+-----------------------------------+
Status Column Codes:
0: Pending (personA wants to be friends with personB)
1: Friends (personA with personB)
* On removal request by either side > delete the corresponding row
我希望能有一个简单的MySQL表,以实现在我的网站上添加好友功能。它只需要拥有是或否的状态。
现在我想了解最佳实践方法,是否有我未注意到的问题。我想查询每个用户的好友,并且用户应该能够将对方添加或从自己的好友列表中删除。