chore(*.psql): update functions; add update_artist_key.psql for merging artists flow

This commit is contained in:
Cory Dransfeldt 2025-04-18 19:51:33 -07:00
parent 15982f220a
commit 678384d8d9
No known key found for this signature in database
8 changed files with 48 additions and 19 deletions

View file

@ -0,0 +1,11 @@
CREATE OR REPLACE FUNCTION update_artist_name(old_artist_name TEXT, new_artist_name TEXT)
RETURNS void AS $$
BEGIN
UPDATE listens
SET artist_name = new_artist_name
WHERE artist_name = old_artist_name;
UPDATE albums
SET artist_name = new_artist_name
WHERE artist_name = old_artist_name;
END;
$$ LANGUAGE plpgsql;