Database Schema - Ashley-B1/Rabbit-Hole GitHub Wiki
Users
| Column Name |
Data Type |
Details |
| id |
integer |
PK |
| userName |
string(50) |
NOT null, unique |
| firstName |
string(50) |
|
| lastName |
string(50) |
|
| email |
string(255) |
NOT null, unique |
| password |
string |
NOT null |
| createdAt |
timestamp |
|
| updatedAt |
timestamp |
|
Posts
| Column Name |
Data Type |
Details |
| id |
integer |
PK |
| userId |
integer |
FK, NOT null |
| title |
string(255) |
NOT null |
| content |
text |
NOT null |
| createdAt |
timestamp |
|
| updatedAt |
timestamp |
|
- ( userId ) references Users.id
Comments
| Column Name |
Data Type |
Details |
| id |
integer |
PK |
| userId |
integer |
FK, NOT null |
| postId |
integer |
FK, NOT null |
| content |
text |
NOT null |
| createdAt |
timestamp |
|
| updatedAt |
timestamp |
|
- ( userId ) references Users.id
- ( postId ) references Posts.id
PostLikes
| Column Name |
Data Type |
Details |
| id |
integer |
PK |
| userId |
integer |
FK, NOT null |
| postId |
integer |
FK, NOT null |
| createdAt |
timestamp |
|
| updatedAt |
timestamp |
|
- ( userId ) references Users.id
- ( postId ) references Posts.id
Follows
| Column Name |
Data Type |
Details |
| id |
integer |
PK |
| userId |
integer |
FK, NOT null |
| followerId |
integer |
FK, NOT null |
| createdAt |
timestamp |
|
| updatedAt |
timestamp |
|
- ( userId ) references Users.id
- ( followerId ) references Users.id