W
W
webivan12015-12-14 22:49:29
MySQL
webivan1, 2015-12-14 22:49:29

Database, how to design users and friends table?

Good afternoon!
I'm trying to do a project - a dating site.
I can't design tables with adding friends, there are users who can apply as friends to other users -
friend_application - (id, user_id, friend_id, status)
So I can pull out all the friends of this user who has applied.
But how to pull out friends from a user who accepted the application, and he could still apply .. it turns out not right.
I can’t think of what tables are needed and links to them ..
Help me figure it out, there are a lot of similar dating sites, but I can’t find information)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2015-12-14
@sim3x

friend_status
  id
  from_user_id
  to_user_id
  status = {
    0: send
    1: confirm
    2: reject
    3:...
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question