chore(*.psql): update functions; add update_artist_key.psql for merging artists flow
This commit is contained in:
parent
15982f220a
commit
678384d8d9
8 changed files with 48 additions and 19 deletions
11
queries/functions/update_artist_key.psql
Normal file
11
queries/functions/update_artist_key.psql
Normal 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;
|
Loading…
Add table
Add a link
Reference in a new issue