DEV Community

Mary Webby
Mary Webby

Posted on

Social Media Set up Tables

1.users
-id
-email
-password
-username
-name
-website_url
-avatar_image_url
-bio
-private
-liked_count

2.follow_requests
-id
-created_at
-updated_at
-sender_id (users)
-recipient_id (users)
-status (accepted, rejected, pending)

3.posts/photo
-id
-created_at
-updated_at
-user_id
-image_url
-caption
-like_count(automatically incs or decs with CRUD)

4.likes-join table (the like to the user)

-id
-post_id
-user_id

5.comments - join table (the comment to the user)
-id
-created_at
-updated_at
-description
-post_id
-user_id

Top comments (0)