Skip to content

Database Schema

Jaden Lambino edited this page May 6, 2022 · 3 revisions

Screen Shot 2022-05-06 at 1 42 06 PM

Users

column name type constraints
id integer primary key
first_name string not null
last_name string not null
username string not null, unique
email string not null, unique
hashed_password string not null

Follows

column name type constraints
followed_id integer not null
followers_id integer not null
  • followed_id references Users table
  • followers_id references Users table

Photos

column name type constraints
id integer primary key
user_id integer not null
photo_url string not null
caption string
  • user_id references Users table

Comments

column name type constraints
id integer primary key
photo_id integer not null
user_id integer not null
body string not null
  • user_id references Users table
  • photo_id references Photos table

Likes

column name type constraints
id integer primary key
photo_id integer not null
user_id integer not null
  • user_id references Users table
  • photo_id references Photos table
Clone this wiki locally