-
Notifications
You must be signed in to change notification settings - Fork 24
Database Schema
Steven Inouye edited this page Dec 11, 2018
·
4 revisions
all currency will be stored in cent value and divided by 100 in the front end to get dollar amount
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
password_digest |
string | not null |
session_token |
string | not null, indexed, unique |
location |
string | *bonus |
created_at |
datetime | not null |
updated_at |
datetime | not null |
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null |
sell_by |
datetime | not null |
title |
string | not null |
location |
string | not null, *bonus |
description |
text | |
buy_it_now |
integer | *bonus |
created_at |
datetime | not null |
updated_at |
datetime | not null |
user id column represents the owner of the product
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed |
product_id |
integer | not null, indexed |
bid_amt |
integer | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
joins table for many to many relationship between user and product and adding bid amount information
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 |
joins table for many to many relationship between product and watcher unique on user_id and product_id
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
product_id |
integer | not null, indexed |
category_id |
integer | not null, indexed |
created_at |
datetime | not null |
updated_at |
datetime | not null |
joins table for many to many relationship between categories and products
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 |