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
Summary
Existing Spotify and Apple Music images in the
release_imagerytable haveNULLvalues forsource_url. This causes the attribution link in the app to either be missing or potentially show incorrect URLs.Background
The
source_urlcolumn was not being populated when Spotify and Apple Music artwork was imported. This was fixed in the import code:https://open.spotify.com/album/{album_id}https://music.apple.com/album/{album_id}However, existing records need to be backfilled.
Task
Write a migration script to update existing records:
Acceptance Criteria
source_urlvaluessource_urlvalues