Skip to content

Database Schema

Joan-Buck edited this page Mar 4, 2022 · 3 revisions

Users

column data type details
id integer not null, primary key, increment
first_name string(50) not null
last_name string(50) not null
email string(50) not null, unique
username string(50) not null, unique
hashedPassword string(100) not null
created_at timestamp not null
updated_at timestamp not null

Library

column data type details
id integer not null, primary key, increment
artist_name string(100) not null
album_name string(100)
album_cover_url string(255)
song_title string(100) not null
song_url string(255) not null
created_at timestamp not null
updated_at timestamp not null

Playlists

column data type details
id integer not null, primary key, increment
user_id integer fkey (refs Users.id)
name string(100) not null
mood_id integer fkey (refs Mood.id)
created_at timestamp not null
updated_at timestamp not null

PlaylistSongs

column data type details
id integer not null, primary key, increment
library_id integer fkey (refs Library.id)
playlist_id integer fkey (refs Playlists.id)
created_at timestamp not null
updated_at timestamp not null

Follows

column data type details
id integer not null, primary key, increment
person_following integer fkey (refs Users.id)
person_followed integer fkey (refs Users.id)
created_at timestamp not null
updated_at timestamp not null

Moods

column data type details
id integer not null, primary key, increment
name string(50) not null
image_url string(255) not null
created_at timestamp not null
updated_at timestamp not null