Hey all, I have discovered a wrinkle about the current structure of the database that came out while working on the MySQL migration. (Just to clarify: this is without any additional tables being made. This is just the new tables from MySQL being moved into Postgres, and the consolidation of the MySQL “rsntr_users” (artists) table with the “UserGroup” table).
Users
have multiple UserGroups
(one of type band, musician, label, distributor). TrackGroups can be either playlists or albums. But! A TrackGroup
belongs to a UserGroup
(eg. an album belongs to a band). However, a Playlist would / should belong to a User
, not a UserGroup
. This wasn’t a problem before because we didn’t really distinguish between Users
and UserGroups
. Everyone was a potential artist / band / label / distributor.
I’m kind of seeing three ways forward.
- Create a second model
Playlist
. We’d have to change the import script to split out playlists and not-playlists during import. Not that big of a deal. Semantically I think this is my preference because Playlists are just such a different concept in a music player. This would probably also argue some of the ambiguity we currently have about it not being clear whatTrackGroup
aTrack
currently originally belongs to. - Create a column on the
TrackGroup
calleduserId
, which is different from thecreatorId
column. Playlists would fill theuserId
column and Trackgroups would fill thecreatorId
column. While running the import script we’d have to decide which one to fill dependent on the type of TrackGroup. - Create a new
UserGroup
for “listeners”, which looks like it was the original intent of the database design, but in this case I’m not sure I see the point of there being a separateRole
(member, artist, admin, superadmin) table as well. However, as far as I can tell the migration from Wordpress touser-api
didn’t do this, only creatingUserGroups
for musicians (ie creators of tracks). Again this would require a migration and also potentially another pass over the WordPress data to import it.
I originally posted this in the Mattermost chat and got some responses from @matt_burnett @piper and @Hakanto
The general so far seems to be leaning towards splitting up the TrackGroup
table into a Playlist
primarily for User
s and TrackGroup
table for UserGroup
s.
Posting it here for transparency and also to get some more input!