Skip to content
shaoevans edited this page Jan 19, 2020 · 3 revisions

Backend Tables

Users

column name data type details
id integer not null, primary key
username string not null, unique, indexed
password digest string not null
session_token string not null, unique, indexed
balance integer not null, default: 1000
date datetime not null
  • index on username, unique: true
  • index on session_token, unique: true

Friendships

column name data type details
id integer not null, primary key
user1_id integer not null, foreign key, indexed
user2_id integer not null, foreign key, indexed
  • index on user1_id
  • index on user2_id
  • combinations of user1_id and user2_idmust be unique

Lobbies

column name data type details
id integer not null, primary key
max_capacity integer not null, default 16
lobby_name string not null
password string optional
balance_limit integer optional
date datetime not null

Messages

column name data type details
id integer not null, primary key
body string not null
author_id integer not null, foreign key
chatroom_id integer not null, foreign key
date datetime not null

ChatRooms

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

User-Chatrooms

column name data type details
id integer not null, primary key
chatroom_id integer not null, foreign key
user_id integer not null, foreign key
Clone this wiki locally