Database Schema - Jasontang98/NoiseNimbus-react-redux Wiki

drawSQL-export-2022-06-24_10_06

users

column name data type details
id integer not null, primary key
username string not null, unique
email string not null, unique
hashedPassword binary not null
createdAt datetime not null
updatedAt datetime not null

songs

column name data type details
id integer not null, primary key
userId integer not null, foreign key
url string not null
title string not null
createdAt datetime not null
updatedAt datetime not null
  • userId references users table

playlists

column name data type details
id integer not null, primary key
userId integer not null, foreign key
title string not null
createdAt datetime not null
updatedAt datetime not null
  • userId references users table

comments

column name data type details
id integer not null, primary key
userId integer not null, foreign key
songId integer not null, foreign key
body text not null
createdAt datetime not null
updatedAt datetime not null
  • userId references users table
  • songId references songs table

SongPlaylists

column name data type details
id integer not null, primary key
playlistId integer not null, foreign key
songId integer not null, foreign key
  • playlistId references users table
  • songId references songs table