-
Notifications
You must be signed in to change notification settings - Fork 0
Schema
yardenroee edited this page May 22, 2019
·
7 revisions
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
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
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 |
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
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
user_id | integer | not null, foreign_key, indexed |
title | string | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
-
user_id
referencesusers
- index on
user_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
song_id | integer | not null, foreign_key, indexed |
playlist_id | integer | not null, foreign_key, indexed |
title | string | not null |
created_at | datetime | not null |
updated_at | datetime | not null |
-
song_id
referencessongs
-
playlist_id
referencesplaylists
- index on
song_id
- index on
playlist_id
column name | data type | details |
---|---|---|
id | integer | not null, primary key |
follower_id | integer | not null, foreign_key, indexed |
followed_id | integer | not null, foreign_key, indexed |
created_at | datetime | not null |
updated_at | datetime | not null |
-
followed_id
referencessongs
-
follower_id
referencesplaylists
- index on
song_id
- index on
playlist_id