Database Schema - AustinW24/instapaws GitHub Wiki

Users

Column Name Data Type Details
id integer not null, PK
username string not null, U
email string not null, U
Biography string not null
profile_pic string not null
  • U is unique

Posts

Column Name Data Type Details
id integer not null, PK
user_Id integer not null, FK
caption string not null
post_url string not null
timestamp datetime not null
  • user_Id references Users table one to many relationship (a user can make many posts, but a post belongs to one user)

Comments

Column Name Data Type Details
id integer not null, PK
comment string not null
user_Id integer not null, FK
post_Id integer not null, FK
timestamp datetime not null
  • user_Id references the Users table one to many relationship (a user can make many comments, but a comment belongs to one user)
  • post_Id references the Posts table one to many relationship (a post can have many comments, but a comment belongs to one post)

Likes

Column Name Data Type Details
user_Id integer not null, FK
post_Id integer not null, PK
  • user_Id references the Users table many to many relationship (users can make likes on many posts)
  • post_Id references the Posts table many to many relationship (posts can have many likes created by many users)