Skip to content
KellyAnneSantos edited this page Dec 12, 2022 · 9 revisions
Screenshot 2022-11-16 at 9 04 55 PM

users

column name data type constraints
id int primary key, auto increment
first_name varchar(50) not null
last_name varchar(50) not null
username varchar(50) not null, unique
email varchar(50) not null, unique
biography varchar(256)
hashed_password varbinary not null
preview_image varchar(256) not null
created_at datetime now(), not null
updated_at datetime now(), not null

followers

column name data type constraints
id int primary key, auto increment
user_id int not null
FK(references: > users.id)
follows_user_id int not null
FK(references: > users.id)
following_status boolean not null, default true
created_at datetime now(), not null
updated_at datetime now(), not null

posts

column name data type constraints
id int primary key, auto increment
user_id int not null
FK(references: > users.id)
caption varchar(256)
location varchar(100)
created_at datetime now(), not null
updated_at datetime now(), not null

media

column name data type constraints
id int primary key, auto increment
user_id int not null
FK(references: > users.id)
post_id int not null
FK(references: > posts.id)
media_file varchar(256) not null
type varchar(256) not null
created_at datetime now(), not null
updated_at datetime now(), not null

like

column name data type constraints
id int primary key, auto increment
user_id int not null
FK(references: > users.id)
post_id int not null
FK(references: > posts.id)
like_status boolean not null, default true
created_at datetime now(), not null
updated_at datetime now(), not null

comments

column name data type constraints
id int primary key, auto increment
user_id int not null
FK(references: > users.id)
post_id int not null
FK(references: > posts.id)
comment varchar(256) not null
created_at datetime now(), not null
updated_at datetime now(), not null

replies

column name data type constraints
id int primary key, auto increment
user_id int not null
FK(references: > users.id)
comment_id int not null
FK(references: > comments.id)
reply varchar(256) not null
created_at datetime now(), not null
updated_at datetime now(), not null
Clone this wiki locally