Repository navigation
Database Schema
Austin Williams edited this page Aug 23, 2021
·
1 revision
| Column Name | Data Type | Details |
|---|---|---|
| id | integer | not null, PK |
| username | string | not null, U |
| string | not null, U | |
| Biography | string | not null |
| profile_pic | string | not null |
- U is unique
| 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_IdreferencesUserstable one to many relationship (a user can make many posts, but a post belongs to one user)
| 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_Idreferences theUserstable one to many relationship (a user can make many comments, but a comment belongs to one user) -
post_Idreferences thePoststable one to many relationship (a post can have many comments, but a comment belongs to one post)
| Column Name | Data Type | Details |
|---|---|---|
| user_Id | integer | not null, FK |
| post_Id | integer | not null, PK |
-
user_Idreferences theUserstable many to many relationship (users can make likes on many posts) -
post_Idreferences thePoststable many to many relationship (posts can have many likes created by many users)