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
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 what
Trackcurrently originally belongs to.
- Create a column on the
userId, which is different from the
creatorIdcolumn. Playlists would fill the
userIdcolumn and Trackgroups would fill the
creatorIdcolumn. While running the import script we’d have to decide which one to fill dependent on the type of TrackGroup.
- Create a new
UserGroupfor “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 separate
Role(member, artist, admin, superadmin) table as well. However, as far as I can tell the migration from Wordpress to
user-apididn’t do this, only creating
UserGroupsfor musicians (ie creators of tracks). Again this would require a migration and also potentially another pass over the WordPress data to import it.
The general so far seems to be leaning towards splitting up the
TrackGroup table into a
Playlist primarily for
TrackGroup table for
Posting it here for transparency and also to get some more input!