Skip to content
shaoevans edited this page Jan 9, 2020 · 6 revisions

users

column name data type details
id integer not null, primary key
username string not null, unique, indexed
email string not null, unique, indexed
password digest string not null
session_token string not null, unique, indexed
password_digest string not null
bullet_elo integer not null
blitz_elo integer not null
classical_elo integer not null
rapid_elo integer not null
training_elo integer not null
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

chess_games

column name data type details
id integer not null, primary key
black_id integer not null, foreign_key, indexed
white_id integer not null, foreign_key, indexed
moves_string string not null
status string not null
created_at datetime not null
updated_at datetime not null
  • index on black_id
  • index on white_id
  • status must be either PENDING or FINISHED

forums

column name data type details
id integer not null, primary key
category string not null

posts

column name data type details
id integer not null, primary key
author_id integer not null, foreign_key, indexed
title string not null
forum_id integer not null, foreign_key, indexed
created_at datetime not null
updated_at datetime not null
  • author_id indexed
  • forum_id indexed

comments

column name data type details
id integer not null, primary key
author_id integer not null, foreign_key, indexed
post_id integer not null, foreign_key, indexed
body string not null
created_at datetime not null
updated_at datetime not null
  • author_id, post_id indexed

blogs

column name data type details
id integer not null, primary key
author_id integer not null, foreign_key, indexed
description string not null
body string not null
created_at datetime not null
updated_at datetime not null
  • author_id indexed
Clone this wiki locally