Hi, I worked as a Database Administrator for over 20 years and I believe there is a straightforward fix to the issue of having to "like" songs multiple times. My suggested database layout is as follows (with a small amount of sample data);
The crucial bit is having the UserLikes table (or whatever its called locally) to reference the Song table. The Song table only has one record per Song, no matter how many playlists it's in and no matter how many different extracts there are of it (i.e. song samples). That way, when somebody likes the song, then they like it everywhere and not just in that playlist. The only time you would have different entries for a song in the Song table by the same artist is when there is a live version or whatever, as the user may or may not like this other version.
I think at the moment that the UserLikes table must be referencing The SongVersion table and hence needing to like songs multiple times.
Please sign in to leave a comment.