Schema - Atar97/FSP Wiki

Database Schema

Users

column name data type details
id integer not null, primary key
email string not null, indexed, unique
fname string not null
lname string not null
DOB datetime not null
gender string
session_token string not null
password_digest string not null
created_at datetime not null
updated_at datetime not null
city string
state string -

Routes

column name data type details
id integer not null, primary key
creator_id integer not null, indexed, foreign key
city string not null
distance integer not null
name string not null
created_at datetime not null
updated_at datetime not null

Workouts

column name data type details
id integer not null, primary key
user_id integer not null, indexed, foreign key
start_time datetime not null
duration string
route_id integer foreign key, indexed
created_at datetime not null
updated_at datetime not null

Friends

column name data type details
id integer not null, primary key
friend1_id integer not null, indexed, foreign key
friend2_id integer not null, indexed, foreign key
created_at datetime not null
updated_at datetime not null

comments

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