title: mysql design for sharing content between friends
body: <p>I'm developing a social network like Facebook but its kind of specific to the users who can join. anyway i have to do a Facebook style wall for each user where he/she can post content.
  (I'm at the first step with posting just text, photos and video are coming).</p>
  
  <p>Now the user should has the ability to define with whom to share the post, 'friends' 'all' 'just me'.</p>
  
  <p>Each user can belong to an institute where also has own wall with posts. the institute should also be able to share posts with user groups.</p>
  
  <p>So my question:</p>
  
  <p>How do I have to design the MySQL tables for this job?</p>
  
  <p>What i have is:</p>
  
  <ul>
  <li>users table :    <code>user_id</code>, ....</li>
  <li>friends table:   <code>id</code>, <code>user_id</code>, <code>friend_id</code>, <code>status</code></li>
  <li>posts table:     <code>post_id</code>, <code>user_id</code>, <code>post_title</code>, <code>post_content</code>, <code>post_date</code></li>
  <li>comments table:  <code>comment_id</code>, <code>user_id</code>, <code>post_id</code>, <code>comment_text</code>, <code>comment_date</code></li>
  </ul>