-
Notifications
You must be signed in to change notification settings - Fork 1
Database Schema
B Salinas edited this page Jun 2, 2021
·
12 revisions
Column Name | Data Type | Details |
---|---|---|
id |
integer | serial, not null, primary key |
username |
string(50) | not null, unique |
hashedPassword |
string.binary | not null |
profilePic |
string(255) | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
- a
user
.hasManyalbums
- a
user
.hasManylikes
- a
user
.hasManycomments
- a
user
.hasManyfollows
Column Name | Data Type | Details |
---|---|---|
id |
integer | serial, not null, primary key |
album_id |
integer | not null, foreignKey |
song_title |
string(150) | not null |
image_url |
varchar | not null, foreignKey |
audio_url |
varchar | not null, |
created_at | datetime | not null |
updated_at | datetime | not null |
- a
song
.belongsTo analbum
- a
song
.hasManylikes
- a
song
.hasManycomments
- FOREIGN KEY album_id REFERENCES Album(id)
- FOREIGN KEY image_url REFERENCES Album(image_url)
Column Name | Data Type | Details |
---|---|---|
id |
integer | serial, not null, primary key |
user_id |
integer | not null, foreignKey |
album_title |
string(150) | not null |
image_url |
string(250) | not null, |
created_at | datetime | not null |
updated_at | datetime | not null |
- an
album
.hasManysongs
- an
album
.belongsTo auser
- FOREIGN KEY user_id REFERENCES Users(id)
Column Name | Data Type | Details |
---|---|---|
id |
integer | serial, not null, primary key |
user_id |
integer | not null |
song_id |
integer | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
- a
like
.belongsTo auser
- a
like
.belongsTo asong
- FOREIGN KEY user_id REFERENCES Users(id)
- FOREIGN KEY song_id REFERENCES Songs(id)
Column Name | Data Type | Details |
---|---|---|
id |
integer | serial, not null, primary key |
user_id |
integer | not null, foreignKey |
song_id |
integer | not null, foreignKey |
content | string(250) | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
- a
comment
.belongsTo auser
- a
comment
.belongsTo asong
- FOREIGN KEY user_id REFERENCES Users(id)
- FOREIGN KEY song REFERENCES Songs(id)
Column Name | Data Type | Details |
---|---|---|
id |
integer | serial, not null, primary key |
user_id |
integer | not null, foreignKey |
followed_user_id |
integer | not null, foreignKey |
created_at | datetime | not null |
updated_at | datetime | not null |
- a
user
.hasManyfollowed_user_id
- a
followed_user_id
.belongsTo auser
- FOREIGN KEY user_id REFERENCES Users(id)
- FOREIGN KEY followed_user_id REFERENCES Users(id)