Skip to content

Database Schema

Benji Rothman edited this page Feb 2, 2019 · 5 revisions

Mystify Database Schema

Users

Column Name Data Type Details
id Integer not null, primary key
email String not null, unique, index
passwordHash String not null
session_token String not null, unique
created_at datetime not null
updated_at datetime not null

Artists

Column Name Data Type Details
id Integer not null, primary key
name String not null, unique, index
bio String not null
imageUrl String not null
created_at datetime not null
updated_at datetime not null

Albums

Column Name Data Type Details
id Integer not null, primary key
title String not null, unique on artistID
artistID Integer not null, index, foreign key
releaseDate String not null
imageUrl String not null
created_at datetime not null
updated_at datetime not null

Tracks

Column Name Data Type Details
id Integer not null, primary key
title String not null, unique on albumID
albumID Integer not null, index, foreign key
songUrl String not null
created_at datetime not null
updated_at datetime not null

Playlists

Column Name Data Type Details
id Integer not null, primary key
title String not null, unique on userID
userID Integer not null, index, foreign key
created_at datetime not null
updated_at datetime not null

Playlists-Tracks

Column Name Data Type Details
id Integer not null, primary key
title String not null, unique on playlistID
playlistID Integer not null, index, foreign key
trackID Integer not null, index, foreign key
created_at datetime not null
updated_at datetime not null

Clone this wiki locally