Schema - AetherVial/Vaporize GitHub Wiki

user

column name data type details
id integer not null, primary key
username string not null, indexed
first_name string not null, indexed
last_name string not null, indexed
email string not null, indexed
password_digest string not null
session_token string not null, indexed, unique
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, indexed
artist_id integer not null, indexed
album_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • artist_id references artists
  • album_id references albums

artists

column name data type details
id integer not null, primary key
name string not null, indexed
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, indexed
artist_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • artist_id references artists

playlists

column name data type details
id integer not null, primary key
title string not null, indexed
user_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • user_id references users

playlist tracks

column name data type details
id integer not null, primary key
track_id integer not null, indexed
playlist_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • track_id references tracks
  • playlist_id references playlists

user follows

column name data type details
id integer not null, primary key
follower_id integer not null, indexed
followed_user_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • follower_id references users
  • followed_user_id references users

artist follows

column name data type details
id integer not null, primary key
artist_id integer not null, indexed
user_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • user_id references users
  • artist_id references artists

playlist follows

column name data type details
id integer not null, primary key
playlist_id integer not null, indexed
user_id integer not null, indexed
created_at datetime not null
updated_at datetime not null

  • user_id references users
  • playlist_id references playlists

favorited tracks

column name data type details
id integer not null, primary key
user_id integer not null, indexed
track_id integer not null, indexed

  • user_id references users
  • track_id references tracks