-
Notifications
You must be signed in to change notification settings - Fork 0
UML to Relations
Kantapon Hemmadhun edited this page Nov 13, 2024
·
21 revisions

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.

| Relation | Attribute | Foreign keys |
|---|---|---|
| Post | post_id user_id p_content timestamp |
user_id: User(user_id) |
| Follower | user_id follower_id |
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 |
|
| UserChat | user_id chat_id |
user_id: User(user_id) chat_id: ChatRoom(chat_id) |
| ChatRoom | chat_id chat_name |
|
| 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) |
| Likes | like_id user_id post_id |
user_id: User(user_id) post_id: Post(post_id) |
| Shares | share_id user_id post_id share_type |
post_id: Post(post_id) user_id: User(user_id) |