feat(db): add artist_similarity_unmatched schema (migration 0012)
This commit is contained in:
@@ -48,3 +48,15 @@ INSERT INTO artist_similarity (artist_a_id, artist_b_id, score, source, fetched_
|
||||
VALUES ($1, $2, $3, 'listenbrainz', now())
|
||||
ON CONFLICT (artist_a_id, artist_b_id, source)
|
||||
DO UPDATE SET score = EXCLUDED.score, fetched_at = EXCLUDED.fetched_at;
|
||||
|
||||
-- name: UpsertArtistSimilarityUnmatched :exec
|
||||
-- Persists an out-of-library similar-artist MBID. Idempotent on
|
||||
-- (seed_artist_id, candidate_mbid, source) — re-fetches refresh the
|
||||
-- name/score and bump fetched_at.
|
||||
INSERT INTO artist_similarity_unmatched (
|
||||
seed_artist_id, candidate_mbid, candidate_name, score, source
|
||||
) VALUES ($1, $2, $3, $4, $5)
|
||||
ON CONFLICT (seed_artist_id, candidate_mbid, source) DO UPDATE SET
|
||||
candidate_name = EXCLUDED.candidate_name,
|
||||
score = EXCLUDED.score,
|
||||
fetched_at = now();
|
||||
|
||||
Reference in New Issue
Block a user