Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Database Schema

Luke-Yamasaki edited this page Feb 7, 2022 · 2 revisions

Users

column name data type details
id integer not null, primary key
username varchar not null, unique
email varchar not null, unique
hashed_password varchar not null
updated_at timestamp not null
created_at timestamp not null

Genres

column name data type details
id integer not null, primary key
user_Id varchar foreign key
name varchar not null, unique
updated_at timestamp not null
created_at timestamp not null

Albums

column name data type details
id integer not null, primary key
user_Id integer not null, foreign key
title varchar not null
genre_Id integer not null, foreign key
image_url varchar optional
reviews integer not null
updated_at timestamp not null
created_at timestamp not null

Tracks

column name data type details
id integer not null, primary key
user_Id integer not null, foreign key
album_Id integer optional, foreign key
genre_Id integer not null, foreign key
title varchar not null
image_url varchar optional
url varchar not null
likes integer not null
downloads integr optional
updated_at timestamp not null
created_at timestamp not null

Reviews

column name data type details
id integer not null, primary key
user_Id integer not null, foreign key
album_Id integer optional, foreign key
title varchar not null
content text
rating integer not null
updated_at timestamp not null
created_at timestamp not null

Comments

column name data type details
id integer not null, primary key
user_Id integer not null, foreign key
track_Id integer optional, foreign key
content text not null
likes integer
updated_at timestamp not null
created_at timestamp not null

Replies

column name data type details
id integer not null, primary key
user_Id integer not null, foreign key
track_Id integer optional, foreign key
comment_Id integer optional, foreign key
content text not null
likes integer
updated_at timestamp not null
created_at timestamp not null

Likes

column name data type details
id integer not null, primary key
user_Id integer not null, foreign key
track_Id integer foreign key
comment_Id integer foreign key
reply_Id integer foreign key
Clone this wiki locally