-
Notifications
You must be signed in to change notification settings - Fork 0
UML to Relations
Nantawan Paramapooti edited this page Dec 23, 2024
·
21 revisions
Updating
Translating directly from UML we've got:
| Relation | Attribute |
|---|---|
| Post | post_id post_content timestamp filter_content |
| User | user_id |
| ChatRoom | chatroom_id |
| ChatRequest | chat request_id action status |
| ChatRole | chatrole_id |
| ChatRank | chatrank_id allowed_actions |
| Message | message_id message_content timestamp |
| Comment | comment_id comment_content timestamp |
| Tag | tag_id tag_content |
| Like | like_id like_type |
| Share | share_id share_type |
| Report | report_id report_content is_justified |
| ReportType | report type_id reporttype_name reporttype_content |
| Notification | notification_id is_read timestamp |
Image from UML can be merged into PostImage and will be explained in the following translation








notifications to post owner


notifications to


interests

disinterests

notifications to post owner

comment



submits
Report


block eachother
















| Relation | Attribute | Foreign keys |
|---|---|---|
| Post | post_id user_id post_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 user_name birthday bio profile header color language filter_content |
|
| UserChat | user_id chat_id |
user_id: User(user_id) chat_id: ChatRoom(chat_id) |
| UserInterest | user_id tag_id |
user_id: User(user_id) tag_id : Tag(tag_id) |
| UserDisinterest | user_id tag_id |
user_id: User(user_id) tag_id : Tag(tag_id) |
| ChatRoom | chat_id chat_name profile |
|
| ChatRequest | chatrequest_id chat_id sender receiver action status |
chat_id : ChatRoom(chat_id) sender : User(user_id) receiver : User(user_id) |
| ChatRole | chatrole_id user_id chatroom_id chatrank_id |
user_id : User(user_id) chatroom_id : ChatRoom(chatroom_id) chatrank_id : ChatRank(chatrank_id) |
| ChatRank | chatrank_id allowed actions |
|
| Message | message_id user_id chat_id message_content timestamp |
user_id: User(user_id) chat_id: ChatRoom(chat_id) |
| Comment | comment_id user_id post_id comment_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) |
| ReportType | reporttype_id reporttype_name reporttype_content |
|
| Report | report_id report_of reporter_id reporttype_id report_content is_justified |
report_of : Class object User, Post, Comment, Chatroom, Message reporter_id : User(user_id) reporttype_id : ReportType(reporttype_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, ChatRole, ChatRequest(receiver/sender is different) receiver_id : User(user_id) |