yh-soft / board

0 stars 0 forks source link

Design DB schema #1

Closed humit0 closed 3 months ago

humit0 commented 3 months ago

Design DB schema for board service.

  1. User
  2. Board
  3. Comment
humit0 commented 3 months ago
erDiagram
    User {
        int user_id PK
        string username
        string password
        string email
        string status
        string created_at
    }
    Board {
        int board_id PK
        string board_name
    }
    Article {
        int article_id PK
        int board_id FK
        int user_id FK
        string title
        string content
    }
    Comment {
        int comment_id PK
        int board_id FK
        int parent_id FK
        string user_id FK
        string content
    }
    User ||--o{ Article : Writes
    Board ||--o{ Article : Has
    Article ||--o{ Comment : Has
    User ||--o{ Comment : Writes