Skip to content

Backfill source_url for existing Spotify and Apple Music images #87

@dprodger

Description

@dprodger

Summary

Existing Spotify and Apple Music images in the release_imagery table have NULL values for source_url. This causes the attribution link in the app to either be missing or potentially show incorrect URLs.

Background

The source_url column was not being populated when Spotify and Apple Music artwork was imported. This was fixed in the import code:

  • Spotify images now store https://open.spotify.com/album/{album_id}
  • Apple Music images now store https://music.apple.com/album/{album_id}

However, existing records need to be backfilled.

Task

Write a migration script to update existing records:

-- Backfill Spotify source_url
UPDATE release_imagery
SET source_url = 'https://open.spotify.com/album/' || source_id
WHERE source = 'Spotify'
  AND source_id IS NOT NULL
  AND source_url IS NULL;

-- Backfill Apple Music source_url
UPDATE release_imagery
SET source_url = 'https://music.apple.com/album/' || source_id
WHERE source = 'Apple'
  AND source_id IS NOT NULL
  AND source_url IS NULL;

Acceptance Criteria

  • All Spotify images have proper source_url values
  • All Apple Music images have proper source_url values
  • Attribution links in the app work correctly for all image sources

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions