Skip to content

Latest commit

 

History

History
55 lines (37 loc) · 870 Bytes

File metadata and controls

55 lines (37 loc) · 870 Bytes

Lecture 107 - API Project Entity Relationship Diagram

Outline

  1. Entities / Schema / Model
  2. ER Diagram

Entities / Schema / Model

What we need to store?

  • User

    • id - int
    • name - string
    • email - string
    • password - string (hashed)
    • role - enum [user, admin] default user
    • status - enum [pending, approved, block, decline]
    • timestamp

  • Article

    • id - int
    • title - string
    • body - text
    • cover - string
    • status - enum [draft, published] default draft
    • authorId - relation with user
    • timestamp

  • Comment

    • id - int
    • body - text
    • authorId - relation with user
    • articleId - relation with article
    • status - enum [public, private]
    • timestamp

ER Diagram

How to store data?

ER Diagram