Skip to content
CelesteComet edited this page Jan 29, 2018 · 3 revisions

Database Schema

users

column name data type details
id integer not null, primary key
username string not null, indexed
email string not null, indexed, unique
img_url string not null
password_digest string not null
session_token string not null, indexed, unique
created_at datetime not null
updated_at datetime not null

Messages

column name data type details
id integer not null, primary key
body string not null
user_id integer not null, indexed, foreign key
room_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null

Rooms

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

Room Membership

column name data type details
id integer not null, primary key
user_id integer not null, indexed, foreign key
room_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null
Clone this wiki locally