Skip to content
Anna Oh edited this page Nov 21, 2017 · 5 revisions

users

Users Data Type Validations
id integer not null, primary key
username string not null, indexed
email string not null, indexed, unique
img_url string
password_digest string not null
session_token string not null, indexed, unique
created_at datetime not null
updated_at datetime not null

photos

Photos Data Type Validations
id integer not null, primary key
img_url string not null
body text
author_id integer not null, indexed, foreign
created_at datetime not null
updated_at datetime not null

comments

Comments Data Type Validations
id integer not null, primary key
body text not null
author_id integer not null, indexed, foreign
photo_id integer not null, indexed, foreign
created_at datetime not null
updated_at datetime not null

likes

Likes Data Type Validations
id integer not null, primary key
user_id integer not null, indexed, foreign
photo_id integer not null, indexed, foreign
created_at datetime not null
updated_at datetime not null

following

Following Data Type Validations
id integer not null, primary key
followers_id integer not null, indexed, foreign
following_id integer not null, indexed, foreign
created_at datetime not null
updated_at datetime not null

Clone this wiki locally