Postgresql Database Schema - arleenpandher/Bamazon Wiki

users

column name data type details
id integer not null, primary key
username string not null, indexed, unique
email string not null, indexed, unique
password_digest string not null
session_token string not null, indexed, unique
created_at datetime not null
updated_at datetime not null

reviews

column name data type details
id integer not null, primary key
user_id integer not null, indexed
product_id integer not null, indexed
title string not null
body string not null
rating integer not null
created_at datetime not null
updated_at datetime not null

transactions

column name data type details
id integer not null, primary key
user_id integer not null, indexed
product_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

carts

column name data type details
id integer not null, primary key
user_id integer not null, indexed
product_id integer not null, indexed
purchased boolean not null
created_at datetime not null
updated_at datetime not null

products

column name data type details
id integer not null, primary key
title string not null
description string not null
service_id integer not null
image url not null
created_at datetime not null
updated_at datetime not null

service

column name data type details
id integer not null, primary key
title string not null
image url not null
created_at datetime not null
updated_at datetime not null