Skip to content

Database schema

Arnold Cabang Jr edited this page Aug 23, 2021 · 2 revisions

Database Schema

users

column name datatype details
id integer not null, primary key
username String not null, unique
firstName String not null
lastName String not null
email String not null, unique
hashedPassword String not null
created_at timestamp not null
updated_at timestamp not null
  • Email unique: true
  • hashedPassword unique: true

games

column name datatype details
id integer not null, primary key
title String not null, unique
studio String not null
avgCleanRating int not null
description String not null
releaseDate varchar not null
created_at timestamp not null
updated_at timestamp not null

shelves

column name datatype details
id integer not null, primary key
name String not null
userId Integer not null, foreign key
created_at timestamp not null
updated_at timestamp not null
  • userId references users table

slapOns

column name datatype details
id integer not null, primary key
gameId Integer foreign key
shelfId Integer not null, foreign key
created_at timestamp not null
updated_at timestamp not null
  • gameId references games table
  • shelfId references shelves table

gameCleanRatings

column name datatype details
id integer not null, primary key
rating Integer not null
userId Integer not null, foreign key
gameId Integer not null, foreign key
created_at timestamp not null
updated_at timestamp not null
  • userId references users table
  • gameId references games table

reviewlikes

column name datatype details
id integer not null, primary key
like boolean not null
reviewsId Integer not null, foreign key
userId Integer not null, foreign key
created_at timestamp not null
updated_at timestamp not null
  • userId references users table
  • reviewsId references reviews table

reviews

column name datatype details
id integer not null, primary key
title varchar not null
content varchar not null
userId Integer not null, foreign key
gameId Integer not null, foreign key
created_at timestamp not null
updated_at timestamp not null
  • userId references users table
  • gameId references games table

Clone this wiki locally