Skip to content
Tong Lam edited this page May 5, 2024 · 13 revisions

User Management

Table: USER

Table: USER_PREFERENCE

Table: USER_RECORD

Table: USER_LIKE

Table: USER_SAVE

Table: USER_NOTICE

Post Management

Table: COMMUNITIES

Table: REQUEST

Table: REPLY

Table: TREDNDING

Table: CATEGORY

Table: TAG

Relation Diagram

---
title: User Management
---
erDiagram
    USER {
      string id PK
      string username UK
      string email UK
      string password "hashing"
      string avatar_url
      boolean use_google
      boolean use_github
      string security_question
      string security_answer
      datetime create_at
      datetime update_at
   }
   USER_PREFERENCE {
      int id PK "auto_increment"
      string user_id FK "user.id"
      string communities "format:1,2,3"
      string interests "format:1,2,3"
      datetime update_at
    }
   USER || --|| USER_PREFERENCE : has
   USER_RECORD {
      int id PK "auto_increment"
      string user_id FK "user.id"
      int request_id FK "request.id"
      datetime update_at "lastViewTime"
   }
   USER || --|{ USER_RECORD : has
   USER_LIKE{
      int id PK "auto_increment"
      string user_id FK "user.id"
      int request_id FK "request.id"
      datetime create_at
   }
   USER || --|{ USER_LIKE : has
   USER_SAVE{
      int id PK "auto_increment"
      string user_id FK "user.id"
      int request_id FK "request.id"
      datetime create_at
   }
   USER || --|{ USER_SAVE : has
   USER_NOTICE{
      int id PK "auto_increment"
      string user_id FK "user.id"
      string subject
      string content
      string module "Post|Comment|Reply|Follow|Like|Save|System"
      bool status "0|1"
      datetime create_at
      datetime update_at
  }
  USER || --|{ USER_NOTICE : has
Loading
---
title: Post Management
---
erDiagram
   COMMUNITIES{
      int id PK "auto_increment"
      string name
      int category_id FK
      string description
      string avatar_url
      datetime create_at
      datetime update_at
   }
   REQUEST{
      int id PK "auto_increment"
      string author_id FK "user.id"
      string title
      string content
      int community_id FK
      int category_id FK
      int view_num
      int like_num
      int reply_num
      int save_num
      datetime create_at
      datetime update_at
   }
   COMMUNITIES || --|{ REQUEST : contains
   REPLY{
      int id PK "auto_increment"
      int request_id FK
      string replier_id FK "user.id"
      int reply_id FK "reply.id"
      string content
      string source "enum (human, ai)"
      int like_num
      int save_num
      datetime create_at
      datetime update_at
   }
   REQUEST || --|{ REPLY : contains
   TREDNDING{
      int id PK "auto_increment"
      int request_id FK
      string author_id FK "redundancy"
      int reply_num "redundancy"
      string date "redundancy"
      datetime update_at
   }
   COMMUNITIES || --|| TREDNDING : has
   CATEGORY {
      int id PK "auto_increment"
      string name
      datetime create_at
   }
   COMMUNITIES || --|| CATEGORY : has
   TAG{
      int id PK "auto_increment"
      string name
      datetime create_at
   }
   REQUEST || --|| TAG : has
Loading
---
title: Notification
---
erDiagram
  
Loading

Clone this wiki locally