Skip to content

Database Schema

Bergan Oudshoorn edited this page May 4, 2021 · 7 revisions

database schema

Relations

  • User Table

    • unique index on username
    • unique indes on email
    • User can have many Posts
    • User can have many Discussion Posts
    • User can have many Reviews
    • User can have many Replies
    • User can have one Shopping Cart
  • Post Table

    • userId references the Users table
    • categoryId references the Category table
    • Post can have many Reviews
    • Post can have one Category
    • Post can have one User
  • Review Table

    • userId references the Users table
    • postId references the Posts table
  • Shopping Cart Table

    • userId references the Users table
    • postId references the Posts table
    • Shopping Cart can have one User
    • Shopping Cart can have many Posts
  • Category Table

    • Category can have many Posts
  • Discussion Table

    • userId references Users table
    • Discussion can have many Replies
  • Reply Table

    • userId references the Users table
    • discussionId references the Discussion table

Clone this wiki locally