Skip to content

Database Schema

NJSim edited this page Nov 18, 2021 · 8 revisions

users

Column Name Data Type Details
id integer not null, primary key
email string
username string not null, unique
bio text
hashedPassword string not null
createdAt timestamp not null
updatedAt timestamp not null

posts

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
caption text
createdAt timestamp not null
updatedAt timestamp not null

likes

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
post_id integer not null
createdAt timestamp not null
updatedAt timestamp not null

comments

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
post_id integer not null
caption text
createdAt timestamp not null
updatedAt timestamp not null

photos

Column Name Data Type Details
id integer not null, primary key
post_id integer not null
URL string
createdAt timestamp not null
updatedAt timestamp not null

followings

Column Name Data Type Details
id integer not null, primary key
user_id integer not null
follower_id integer not null
accepted bool not null
createdAt timestamp not null
updatedAt timestamp not null

Clone this wiki locally