Schema - RizzaCarla/Satisfy GitHub Wiki
Satisfy Schema
user
| Column | Data Type | Validations/Constraints |
|---|---|---|
id |
integer | not null, primary key |
username |
string | not null, indexed, present, unique |
email |
string | not null, indexed, present, unique |
session_token |
string | not null, indexed, present, unique |
password_digest |
string | not null, present |
created_at |
datetime | not null |
updated_at |
datetime | not null |
has_one: main_playlisthas_many: other_playlists
artist
| Column | Data Type | Validations/Constraints |
|---|---|---|
id |
integer | not null, primary key |
artist_name |
string | not null, indexed, present, unique |
created_at |
datetime | not null |
updated_at |
datetime | not null |
artist_namereferences the stage name of the artist.has_many: albums
album
| Column | Data Type | Validations/Constraints |
|---|---|---|
id |
integer | not null, primary key |
album_title |
string | not null, indexed, present |
artist_id |
integer | not null, indexed, present |
created_at |
datetime | not null |
updated_at |
datetime | not null |
album_titlereferences the album namebelongs_to: artisthas_many: songs
song
| Column | Data Type | Validations/Constraints |
|---|---|---|
id |
integer | not null, primary key |
album_id |
integer | not null, indexed, present, unique |
total_song_time |
string | not null, indexed, present |
song_title |
string | not null, indexed, present |
created_at |
datetime | not null |
updated_at |
datetime | not null |
has_many: main_playlist_likeshas_many: other_playlist_likesbelongs_to: albumsong_titlereferences the song nametotal_song_timewill be a string. minutes and seconds are separated by ":".
like
| Column | Data Type | Validations/Constraints |
|---|---|---|
id |
integer | not null, primary key |
likeable_type |
string | not null |
likeable_id |
bitint | not null |
created_at |
datetime | not null |
updated_at |
datetime | not null |
- a user can like an album, artist, song, and will be added to their respective pages