Skip to content

Instantly share code, notes, and snippets.

@avidrucker
Last active July 19, 2024 15:05
Show Gist options
  • Save avidrucker/a97ec167cc30bfd2000b5978075a086f to your computer and use it in GitHub Desktop.
Save avidrucker/a97ec167cc30bfd2000b5978075a086f to your computer and use it in GitHub Desktop.
Entity Relationship Diagram for Social Media Full Stack Application
erDiagram
  USER {
    integer id PK
    string username UK
    string fname
    string mname "optional"
    string lname
    string initials "initialized programmatically"
    string profile_color "initialized randomly"
    string password
  }
  POST {
    integer id PK
    datetime creation_date
    boolean edited "default false"
    string text_body
    integer writer_id FK
  }
  LIKE {
    integer id PK
    integer liking_user_id FK
    integer liked_post_id FK
  }
  USER ||--o{ POST : "creates, is created by"
  USER ||--o{ LIKE : "leaves, is left by"
  POST ||--o{ LIKE : "contains, is contained by"
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment