Skip to content

Database Schema

Michael edited this page Jul 19, 2022 · 1 revision

image

Users

column name data type details
id integer not null, primary key
profile_pic varchar
first_name varchar not null
last_name varchar not null
user_name varchar not null
email varchar not null
address varchar not null
hashed_password varchar not null
createdAt timestamp
updatedAt timestamp

Reviews

column name data type details
id integer not null, primary key
user_id integer not null
snack_id integer not null
comment text not null
created_at timestamp
updatedAt timestamp
  • user_id references the Users table
  • snack_id references the Snacks table

Shopping Cart

column name data type details
id integer not null, primary key
user_id integer not null
total integer not null
created_at timestamp
updatedAt timestamp

Cart Item

column name data type details
id integer not null, primary key
shopping-cart-id integer not null
snack_id integer not null
quanity integer not null
created_at timestamp
updatedAt timestamp
  • shopping-cart-id references the Shopping Cart table
  • snack_id references the Snacks table

Snacks

column name data type details
id integer not null, primary key
user_id integer not null
cover_pic varchar not null
title varchar not null
description text not null
price integer not null
category varchar not null
created_at timestamp
updated_at timestamp
  • user_id references the Users table

Clone this wiki locally