-
Notifications
You must be signed in to change notification settings - Fork 0
UML to Relations

This relation represents posts made by users in the system. Each user can create multiple posts, allowing for a one-to-many relationship between the User table and the Post table

This relation represents chat rooms that users can join. Each chat room is identified by a unique chat_id and has a chat_name for easy identification. Users can participate in multiple chat rooms, enabling group conversations or topic-specific discussions within the application.

This relation represents the blocking relationships between users, allowing for a many-to-many association where one user can block multiple users

This relation represents the following relationships between users, allowing for a many-to-many association where one user can follow each other.

This relation represents messages sent by users in chat rooms. Each message is associated with one user (sender_id) and one chat room (chat_id). However, each chat room can contain multiple messages, reflecting the many-to-one relationship between Message and ChatRoom

This table represents comments made by users on posts. Each comment is linked to a specific user (sender_id) and a specific post (post_id). This setup allows each post to have multiple comments from different users, reflecting the one-to-many relationship between Post and Comment.

The table serves to organize and categorize posts within the application, allowing users to easily find and filter posts based on relevant keywords. Each tag can be associated with one or more posts, and each post can have multiple tags, facilitating a many-to-many relationship between posts and tags.

Each record represents a like given by a specific user (liker_id) on a specific post (post_id). This setup enables a many-to-many relationship between User and Post, as each user can like multiple posts, and each post can receive multiple likes.

Each user can share multiple posts, and each post can be shared by multiple users, creating a many-to-many relationship between User and Post through the Shares table.
| Relation | Attribute | Foreign keys |
|---|---|---|
| Post | post_id user_id p_content timestamp filter_content |
user_id: User(user_id) |
| Follower | user_id follower_id notify |
user_id: User(user_id) follower_id: User(user_id) |
| Blocker | blocker_id blocked_id |
blocker_id: User(user_id) blocked_id: User(user_id) |
| User | user_id username password name bio profile header color language filter_content |
|
| UserChat | user_id chat_id |
user_id: User(user_id) chat_id: ChatRoom(chat_id) |
| ChatRoom | chat_id chat_name chat_owner profile |
|
| Message | message_id user_id chat_id ms_content timestamp |
user_id: User(user_id) chat_id: ChatRoom(chat_id) |
| Comment | comment_id user_id post_id c_content timestamp |
user_id: User(user_id) post_id: Post(post_id) |
| Tag | tag_id tag_content |
|
| PostTag | tag_id post_id |
tag_id: Tag(tag_id) post_id: Post(post_id) |
| Like | like_id user_id post_id like_type |
user_id: User(user_id) post_id: Post(post_id) |
| Share | share_id user_id post_id share_type |
post_id: Post(post_id) user_id: User(user_id) |
| Report | report_id report_of reporter_id report_type content |
report_of : Class object User, Post, Comment, Chatroom, Message reporter_id : User(user_id) |
| PostImage | postimage_id post_id image |
post_id : Post(post_id) |
| Notification | notification_id notification_of receiver_id is_read timestamp |
notification_of : Class object Follow, Like, Share, Post, Comment, Message receiver_id : User(user_id) |
| Interest | interest_id user_id tag_id |
user_id:User(user_id) tag_id:Tag(tag_id) |
| Disinterest | disinterest_id user_id tag_id |
user_id:User(user_id) tag_id:Tag(tag_id) |