Skip to content

Database Schema

Parker Bolick edited this page Nov 16, 2021 · 4 revisions

Image of Schema

Users

Column Name Data Type Details
id integer not null, primary key
username string not null, unique
email string
hashedPassword string not null
createdAt timestamp not null
updatedAt timestamp not null

Assets

Column Name Data Type Details
id integer not null, primary key
ticker string not null
name string not null
location string not null
founded string not null
total_emp integer not null
ceo string not null
createdAt timestamp not null
updatedAt timestamp not null

Transactions

Column Name Data Type Details
id integer not null, primary key
userId integer not null, foreign key
assetId integer not null, foreign key
shares integer not null
orderType integer not null
orderPrice integer not null
limit boolean not null, default: false
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table
  • assetId references Assets table
  • orderType determines buy or sell. 0 - Buy, 1 - Sell

Watchlist

Column Name Data Type Details
id integer not null, primary key
title string not null
userId integer not null, foreign key
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table

AssetToWatchlist

Column Name Data Type Details
id integer not null, primary key
assetId integer not null, foreign key
userId integer not null, foreign key
createdAt timestamp not null
updatedAt timestamp not null
  • userId references Users table
  • assetId references Assets table

Clone this wiki locally