Skip to content

Database Schema

88joonyc edited this page Aug 15, 2021 · 22 revisions

Users

column name data type details
id integer not null, PK
email string not null, unique
first_name string not null, unique
last_name string not null, unique
user_name string not null, unique
hashed_password string not null
date_of_birth date not null
wallet integer
created_at date not null
updated_at date not null
  • User hasMany Shares
  • User hasMany watchlist
  • User hasMany Tokens

SneaX

column name datatype details
id integer not null, PK
name string not null
market_price int not null
image string not null
details string not null
brand_name string not null
created_at date not null
updated_at date not null
  • SneaX belongsTo shares
  • Sneax belongsTo watch

Shares

column name data type details
id integer not null, PK
user_id integer not null
sneax_id integer not null
price_per_share Integer not null
number_of_shares Integer not null
created_at date not null
updated_at date not null
  • Shares belongs to User

Watchlist

column name datatype details
id integer not null, PK
list_name string not null
user_id integer not null
created_at date not null
updated_at date not null
  • Watchlist belongsTo User
  • Watchlist hasMany watch

Watch

column name datatype details
id integer not null, PK
watchlist_id integer not null
sneax_id integer not null
created_at date not null
updated_at date not null
  • Watch belongsTo Watchlist
  • Watch belongsTo Sneax
Screen Shot 2021-08-11 at 5 40 36 PM

Clone this wiki locally