You are on page 1of 1

Entities:

1. User
• UserID (Primary Key)
• Username
• Email
• PasswordHash
• JoinDate
• LastLogin
• FirstName
• LastName
• DateOfBirth
• Gender
• Bio
• ProfilePictureURL
• WebsiteURL
• PhoneNumber
• PrivacySettings (e.g., public, private, friends-only)
• AccountStatus (e.g., active, inactive, suspended)
• AccountType (e.g., regular user, verified user, administrator)

2. Post
• PostID (Primary Key)
• UserID (Foreign Key referencing User.UserID)
• Content
• MediaURL (for images, videos, etc.)
• Timestamp
• PrivacySettings

3. Comment
• CommentID (Primary Key)
• PostID (Foreign Key referencing Post.PostID)
• UserID (Foreign Key referencing User.UserID)
• Content
• Timestamp

4. Like
• LikeID (Primary Key)
• PostID (Foreign Key referencing Post.PostID)
• UserID (Foreign Key referencing User.UserID)
• Timestamp

5. Notification
• NotificationID (Primary Key)
• UserID (Foreign Key referencing User.UserID)
• Type (e.g., "Comment", "Like", "Follow")
• InteractionID (ID of the related interaction, e.g., CommentID, LikeID, or FollowID)
• Timestamp
• IsRead (to mark whether the notification has been read)

6. Follow
• FollowID (Primary Key)
• FollowerUserID (Foreign Key referencing User.UserID)
• FollowedUserID (Foreign Key referencing User.UserID)
• Timestamp

Relationships:
• One user can make many posts. (One-to-Many relationship between User and Post)
• One post can have many comments. (One-to-Many relationship between Post and Comment)
• One post can have many likes. (One-to-Many relationship between Post and Like)
• One user can make many comments. (One-to-Many relationship between User and Comment)
• One user can like many posts. (One-to-Many relationship between User and Like)
• One user can receive many notifications. (One-to-Many relationship between User and
Notification)
• One user can follow many other users, and one user can be followed by many other users.
(Many-to-Many relationship between User and User through the Follow entity)

You might also like