-
Notifications
You must be signed in to change notification settings - Fork 0
DB Schema
Andres Alfaro edited this page Sep 20, 2017
·
5 revisions
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, unique |
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 |
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
title |
string | not null |
length |
integer | not null, |
explicit |
boolean | not null, |
img_url |
string | not null |
release_yr |
integer | not null, |
artist_id |
integer | not null, indexed, foreign key |
album_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
album_id
referencesalbum
-
artist_id
referencesartist
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
title |
string | not null |
img_url |
string | not null |
artist_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
artist_id
referencesartist
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null |
img_url |
string | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
name |
string | not null |
author_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
author_id
referencesuser
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
playlist_id |
integer | not null, indexed, foreign key |
song_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
playlist_id
referencesplaylist
-
song_id
referencessong
- index on
[:user_id, :playlist_id], unique: true
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
user_id |
integer | not null, indexed, foreign key |
friend_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
user_id
referencesuser
-
friend_id
referencesuser
- index on
[:user_id, :friend_id], unique: true
column name | data type | details |
---|---|---|
id |
integer | not null, primary key |
playlist_id |
integer | not null, indexed, foreign key |
user_id |
integer | not null, indexed, foreign key |
created_at |
datetime | not null |
updated_at |
datetime | not null |
-
playlist_id
referencesplaylist
-
user_id
referencesuser
- index on
[:user_id, :playlist_id], unique: true