chore(*.sql): use sql-formatter for sql formatting
This commit is contained in:
parent
cf1ee4c97f
commit
1d7f13d1f5
63 changed files with 4432 additions and 2358 deletions
|
@ -1,17 +1,30 @@
|
|||
BEGIN
|
||||
UPDATE artists
|
||||
SET total_plays = total_plays + 1
|
||||
WHERE name_string = NEW.artist_name;
|
||||
UPDATE albums
|
||||
SET total_plays = total_plays + 1
|
||||
WHERE key = NEW.album_key
|
||||
AND artist_name = NEW.artist_name;
|
||||
UPDATE genres
|
||||
SET total_plays = total_plays + 1
|
||||
WHERE id = (
|
||||
SELECT genres
|
||||
FROM artists
|
||||
WHERE name_string = NEW.artist_name
|
||||
UPDATE artists
|
||||
SET
|
||||
total_plays = total_plays + 1
|
||||
WHERE
|
||||
name_string = NEW.artist_name;
|
||||
|
||||
UPDATE albums
|
||||
SET
|
||||
total_plays = total_plays + 1
|
||||
WHERE
|
||||
key = NEW.album_key
|
||||
AND artist_name = NEW.artist_name;
|
||||
|
||||
UPDATE genres
|
||||
SET
|
||||
total_plays = total_plays + 1
|
||||
WHERE
|
||||
id = (
|
||||
SELECT
|
||||
genres
|
||||
FROM
|
||||
artists
|
||||
WHERE
|
||||
name_string = NEW.artist_name
|
||||
);
|
||||
RETURN NEW;
|
||||
|
||||
RETURN NEW;
|
||||
|
||||
END;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue