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_playlist
  • has_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_name references 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_title references the album name
  • belongs_to: artist
  • has_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_likes
  • has_many: other_playlist_likes
  • belongs_to: album
  • song_title references the song name
  • total_song_time will 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