Skip to content

DB Schema

Tanner edited this page Feb 15, 2022 · 12 revisions

Link to Database: dbdiagram

Users

column name data type details
id integer not null, primary key
username string not null, unique
email string not null, unique
hashed_password string not null
full_name string not null
profile_pic string not null

Posts

column name data type details
id integer not null, primary key
user_id int not null, foreign key
caption text
  • user_id references users table

Post_likes

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
post_id integer not null, foreign key
  • user_id references users table
  • post_id references posts table

Photos

column name data type details
id integer not null, primary key
photo string not null
post_id integer not null, foreign key
  • post_id references posts table

Comments

column name data type details
id integer not null, primary key
comment text not null
user_id integer not null, foreign key
post_id integer not null, foreign key
  • user_id references users table
  • post_id references posts table

Followers

column name data type details
id integer not null, primary key
user_id integer not null, foreign key
follower integer not null, foreign key
  • user_id references users table
  • follower references users table

Clone this wiki locally