Schema - GilBu/modestpack GitHub Wiki

Welcome to the modestpack 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
  • index on username, unique: true
  • index on email, unique: true
  • index on session_token, unique: true

games

column name data type details
id integer not null, primary key
title string not null, indexed, unique
price integer not null
description text not null
sale integer not null
platform array not null
operating system string not null
developer string not null
publisher string not null
system requirements string not null
links string
ratings string
rating list array
created_at datetime not null
updated_at datetime not null
  • index on title, unique: true
  • index on price
  • index on platform
  • index on operating system
  • index on developer
  • index on publisher
  • index on ratings

user_libraries

column name data type details
id integer not null, primary key
owner_id integer not null, unique
game_id integer not null
purchase_date datetime not null
created_at datetime not null
updated_at datetime not null
  • owner_id reference users
  • game_id reference games

shopping_carts

column name data type details
id integer not null, primary key
user_id integer not null
fulfilled boolean not null
created_at datetime not null
updated_at datetime not null
  • user_id references users

shopping_carts_games

column name data type details
id integer not null, primary key
cart_id integer not null
game_id integer not null
created_at datetime not null
updated_at datetime not null
  • cart_id references shopping_carts
  • game_id references games

genres

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

game_genres

column name data type details
id integer not null, primary key
genre_id integer not null
game_id integer not null
created_at datetime not null
updated_at datetime not null
  • genre_id references genres
  • game_id references games