Schema - erinicole/RentClothesWithPockets GitHub Wiki
Database Schema
users
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
first_name |
string | |
last_name |
string | |
birthday |
date | not null |
zip_code |
integer | |
phone_number |
integer | |
height |
string | |
weight |
integer | |
bust_size |
string | |
body_type |
string | |
jean_size |
integer | |
dress_size |
integer | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
email, unique: true
- index on
session_token, unique: true
products
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
title |
string | not null, indexed, unique |
designer_id |
integer | not null, indexed |
category_id |
integer | not null, indexed |
stylist_notes |
string | not null |
product_details |
string | not null |
style_and_fit |
string | not null |
season |
string | not null |
occasion |
string | not null |
price |
integer | not null |
color |
string | not null |
formality |
string | not null |
weather |
string | not null |
body_type |
string | not null |
sleeves |
string | not null |
length |
string | |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- index on
title, unique: true
designer_id
referencesdesigners
category_id
referencescategories
categories
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
items
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
item_id |
integer | not null, indexed |
size |
integer | not null |
qty |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
product_id
referencesproducts
shopping_carts
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
product_id |
number | not null, indexed |
start_date |
date | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
user_id
referencesusers
product_id
referencesproducts
reviews
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
product_id |
integer | not null, indexed |
body |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
user_id
referencesusers
product_id
referencesproducts
shortlists
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
shortlist_item_id |
integer | not null, indexed |
title |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
user_id
referencesusers
shortlist_items_id
referencesshortlist_items
shortlist_items
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
shortlist_id |
integer | not null, indexed |
product_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
shortlist_id
referencesshortlists
product_id
referencesproducts
designers
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
designer_name |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |