chore(*.psql/*.sql): update all *.psql to *.sql files
This commit is contained in:
parent
c9015a7f2b
commit
fc37600b8b
63 changed files with 21 additions and 41 deletions
|
@ -2,12 +2,10 @@ BEGIN
|
|||
UPDATE artists
|
||||
SET total_plays = total_plays - 1
|
||||
WHERE name_string = OLD.artist_name;
|
||||
|
||||
UPDATE albums
|
||||
SET total_plays = total_plays - 1
|
||||
WHERE name = OLD.album_name
|
||||
AND artist_name = OLD.artist_name;
|
||||
|
||||
UPDATE genres
|
||||
SET total_plays = total_plays - 1
|
||||
WHERE id = (
|
||||
|
@ -15,6 +13,5 @@ BEGIN
|
|||
FROM artists
|
||||
WHERE name_string = OLD.artist_name
|
||||
);
|
||||
|
||||
RETURN OLD;
|
||||
END;
|
|
@ -4,7 +4,6 @@ BEGIN
|
|||
IF NEW.air_date < CURRENT_DATE AND NEW.status = 'upcoming' THEN
|
||||
NEW.status := 'aired';
|
||||
END IF;
|
||||
|
||||
RETURN NEW;
|
||||
END;
|
||||
$$ LANGUAGE plpgsql;
|
|
@ -2,12 +2,10 @@ 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 = (
|
||||
|
@ -15,6 +13,5 @@ BEGIN
|
|||
FROM artists
|
||||
WHERE name_string = NEW.artist_name
|
||||
);
|
||||
|
||||
RETURN NEW;
|
||||
END;
|
Loading…
Add table
Add a link
Reference in a new issue