Database Schema - Shelchamp/RumTumTugger GitHub Wiki

users


column name data type details
id integer not null, primary key
username string unique, not null, indexed
email string unique, not null, indexed
image_url string
bio text
password_digest string not null
session_token string not null, indexed

followers


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

posts


column name data type details
id integer not null, primary key
post_type string not null
title string
body text
image_url string
user_id integer foreign key (references users), not null, indexed

tags


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

taggings


column name data type details
id integer not null, primary key
post_id integer foreign key (references posts), not null, indexed
tag_id integer foreign key (references tags), not null, indexed

likes


column name data type details
id integer not null, primary key
post_id integer foreign key (references posts), not null, indexed
user_id integer foreign key (references users), not null, indexed