Skip to content
yardenroee edited this page May 22, 2019 · 7 revisions

Database Schema

users

column name data type details
id integer not null, primary key
username string not null, indexed
password_digest string not null
session_token string not null, indexed, unique
img_url string
username string not null, indexed
created_at datetime not null
updated_at datetime not null
  • index on username, unique: true
  • index on session_token, unique: true

albums

column name data type details
id integer not null, primary key
title string not null
artist_id integer not null, indexed, foreign_key
release_year integer
created_at datetime not null
updated_at datetime not null
  • index on artist_id

artists

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

songs

column name data type details
id integer not null, primary key
album_id integer not null, foreign_key, indexed
artist_id integer not null, foreign_key, indexed
title string not null
length string not null
created_at datetime not null
updated_at datetime not null
  • index on album_id
  • index on artist_id

playlists

column name data type details
git status git status git status
git diff git diff git diff

playlist_songs

column name data type details
git status git status git status
git diff git diff git diff

follows

column name data type details
git status git status git status
git diff git diff git diff
Clone this wiki locally