Database Schema - dhoffmann1/Sweetiegram GitHub Wiki
Database Schema Design for Sweetiegram

Users
column name |
data type |
details |
id |
integer |
not null, primary key |
email |
text |
not null, unique |
first_name |
text |
not null |
last_name |
text |
not null |
password |
text |
not null |
username |
text |
not null, unique |
bio |
text |
|
profile_pic_url |
text |
|
Posts
column name |
data type |
details |
id |
integer |
not null, primary key |
post_url |
text |
not null, unique |
owner_id |
integer |
not null, foreign key |
city |
text |
|
state |
text |
|
country |
text |
|
caption |
text |
|
created_at |
datetime |
|
updated_at |
datetime |
|
owner_id
references Users
table
Comments
column name |
data type |
details |
id |
integer |
not null, primary key |
post_id |
integer |
not null, foreign key |
user_id |
integer |
not null, foreign key |
content |
text |
not null |
created_at |
datetime |
|
updated_at |
datetime |
|
post_id
references Posts
table
user_id
references Users
table
Likes
column name |
data type |
details |
post_id |
integer |
not null, foreign key |
user_id |
integer |
not null, foreign key |
post_id
references Posts
table
user_id
references Users
table
Following
column name |
data type |
details |
user_following |
integer |
not null |
user_followers |
integer |
not null |
user_following
references Users
table
user_followers
references Users
table