Schema - Heyitswilson/Toasty-fullstack GitHub Wiki
Database Schema
users
column_name |
data_type |
details |
|---|---|---|
id |
integer | not null, primary key |
name |
string | not null |
email |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
- index on
emailandsession_token,unique: true
products
column_name |
data_type |
details |
|---|---|---|
id |
integer | not null, primary key |
name |
string | not null, unique, indexed |
description |
string | not null |
price |
integer | not null |
artist_id |
integer | not null, indexed, foreign key |
artist_idreferencesusers- index on
artist_idandname unique: trueon name
reviews
column_name |
data_type |
details |
|---|---|---|
id |
integer | not null, primary key |
review |
string | not null |
rating |
integer | not null |
author_id |
integer | not null, indexed, foreign key |
product_id |
integer | not null, indexed, foreign key |
author_idreferencesusers, indexedproduct_idreferencesproducts, indexed
cart_items
column_name |
data_type |
details |
|---|---|---|
id |
integer | not null, primary key |
product_id |
integer | not null, indexed, foreign_key |
cart_id |
integer | not null, indexed, foreign_key |
customer_id |
integer | not null, indexed, foreign_key |
quantity |
integer | not null |
cart_idreferencescarts, indexedproduct_idreferencesproducts, indexedcustomer_idreferencesusers, indexed