Database Schema - Keipara/SoundtrackCloud GitHub Wiki

Database Schema

Users

column name data type details
id serial not null, primary key
firstName varchar not null
lastName varchar not null
email varchar not null, unique
username varchar not null, unique
hashedPassword varchar not null

Songs

column name data type details
id serial not null, primary key
title varchar not null
songFile varchar not null, foreign key
userId int not null, foreign key
  • Ref: users.id > songs.id

Comments

column name data type details
id serial not null, primary key
body varchar not null
songId int
userId int not null
  • Ref: users.id > comments.userId
  • Ref: songs.id > comments.songId

Playlists

column name data type details
id serial not null, primary key
name varchar not null
userId int not null, foreign key
  • Ref: users.id > songs.id