Skip to content

Database Schema

stevenpicazo edited this page Feb 19, 2023 · 2 revisions

Schema for Project:

users

column name data type details
id integer not null, primary key
username string not null,
email string not null, indexed, unique
created_at datetime not null
updated-at datetime not null
first_name string not null
last_name string not null
address string not null
city string not null
state string not null
zip string not null
country string not null
trusted_seller string null
gender_style string null
shirt_size string null
pant_size string null
shoe_size string null

items

column name data type details
id integer not null, primary key
seller_id integer not null, primary key
name string not null, primary key
size integer not null, foreign key
gender_style string null
color string not null
condition string not null
category_tags string null
price integer not null
shipping_cost integer not null
sold boolean null
  • user_id references users table
  • seller_id references orders table

likes

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
item_id integer not null, foreign key
  • user_id references users table
  • item_id references items table

orders

column name data type details
id integer not null, primary key
buyer_id integer not null, foreign key
item_id integer not null, foreign key
seller_id integer not null
order_total integer not null
expiry integer not null
cvc integer not null
country string not null
card_zip integer not null
shipping string not null
  • buyer_id references users table
  • item_id references items table

reviews

column name data type details
id integer not null, primary key
buyer_id integer not, foreign key
item_id integer not, foreign key
review_body string not null
stars integer not null
  • buyer_id references users table
  • item_id references an item from items table

item-images

column name data type details
id integer not null, primary key
item_id integer not null, foreign key
preview boolean not null
url string not null
image_num string not null
  • item_id references items table
Clone this wiki locally