Skip to content
Americo edited this page Apr 11, 2018 · 23 revisions

Schema Information

users

column name data type details
id integer not null, primary key
username string not null, indexed, unique
password_digest string not null
session_token string not null, indexed, unique
first_name string not null
last_name string not null

activities

column name data type details
id integer not null, primary key
title string not null
user_id integer not null, foreign key (references users), indexed
polyline text not null (enconded polyline from google)
big_image_url text not null (maps static api url)
distance float not null (in miles, two decimal digits)
elevation float not null (in feet, no decimals)
duration integer not null (in seconds)
sport string not null (in seconds)
start_datetime timestampz not null

routes

column name data type details
id integer not null, primary key
name string not null
description text not null
author_id integer not null, foreign key (references users), indexed
polyline text not null (enconded polyline from google)
image_url text not null (maps static api url)
big_image_url text not null (maps static api url)
distance float not null (in miles, two decimal digits)
elevation float not null (in feet, no decimals)
duration integer not null (in seconds)
sport string not null (in seconds)

comments

column name data type details
id integer not null, primary key
body text not null
commenter_id integer not null, foreign key (references users), indexed
activity_id integer not null, foreign key (references activities), indexed

likes

column name data type details
id integer not null, primary key
liker_id integer not null, foreign key (references users), indexed
activity_id integer not null, foreign key (references activities), indexed

follows

column name data type details
id integer not null, primary key
follower_id integer not null, foreign key (references users), indexed
followee_id integer not null, foreign key (references users), indexed

images

column name data type details
id integer not null, primary key
url string not null
user_id integer foreign key (references users), indexed, unique
route_id integer foreign key (references routes), indexed, unique
activity_id integer foreign key (references activities), indexed
                                            |
Clone this wiki locally