Database Schema - sheriffhoodie/bandom GitHub Wiki

users

column name data type details
id integer, not null primary key
username string, not null indexed
email string, not null indexed, unique
img_url string, not null
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
album_id integer, not null indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • album_id references albums

albums

column name data type details
id integer, not null primary key
title string, not null
author_id integer, not null indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • author_id references users

follows

column name data type details
id integer, not null primary key
title string, not null
user_id integer, not null indexed, foreign key
created_at datetime not null
updated_at datetime not null
  • user_id references users
  • index on [:user_id], unique: true