Uploaded image for project: 'ListenBrainz'
  1. ListenBrainz
  2. LB-866

Use user ids in the listen table instead of usernames

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Normal Normal
    • None
    • None
    • None

      We currently use a username in the listens table to reference the user for who a listen refers to.

      In order to allow users to rename their accounts, we should use a user_id field here instead. Note that as this table is in a separate database instance we won't be able to set a foreign key. This is the same situation that we have in the playlists tables, which are in the same db instance.

      To perform the migration, we should do multiple steps

      1. add column to the table
      2. update listen writer to write both user id and username for new listens
      3. set background worker to update this field on old listens
      4. update listenstore to only use user id instead of username
      5. delete username column

            kartik1712 amCap1712
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package