-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' of github.com:go-park-mail-ru/2024_2_NovaCode into…
… dev
- Loading branch information
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
49 changes: 49 additions & 0 deletions
49
internal/db/postgres/migrations/20241221003846_artist_joji.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
INSERT INTO artist | ||
(name, bio, country, image) | ||
VALUES | ||
('joji', 'Joji and formerly as Filthy Frank and Pink Guy, is a Japanese-Australian comedian, singer-songwriter, rapper, and record producer.', 'Japan', 'joji.webp'); | ||
|
||
INSERT INTO album | ||
(name, image, artist_id) | ||
VALUES | ||
('SMITHEREENS', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji')); | ||
|
||
INSERT INTO track | ||
(name, duration, filepath, image, artist_id, album_id, track_order_in_album) | ||
VALUES | ||
('Die For You', 212, 'joji_smithereens_1.mp3', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji'), (SELECT id FROM album WHERE name = 'SMITHEREENS'), 1), | ||
('Dissolve', 177, 'joji_smithereens_2.mp3', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji'), (SELECT id FROM album WHERE name = 'SMITHEREENS'), 2), | ||
('NIGHT RIDER', 128, 'joji_smithereens_3.mp3', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji'), (SELECT id FROM album WHERE name = 'SMITHEREENS'), 3), | ||
('BLAHBLAHBLAH DEMO', 143, 'joji_smithereens_4.mp3', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji'), (SELECT id FROM album WHERE name = 'SMITHEREENS'), 4), | ||
('YUKON (INTERLUDE)', 141, 'joji_smithereens_5.mp3', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji'), (SELECT id FROM album WHERE name = 'SMITHEREENS'), 5), | ||
('1AM FREESTYLE', 113, 'joji_smithereens_6.mp3', 'joji_smithereens.webp', (SELECT id FROM artist WHERE name = 'joji'), (SELECT id FROM album WHERE name = 'SMITHEREENS'), 6); | ||
|
||
INSERT INTO genre_artist (genre_id, artist_id) VALUES | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM artist WHERE name = 'joji')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM artist WHERE name = 'joji')); | ||
|
||
INSERT INTO genre_track (genre_id, track_id) VALUES | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM track WHERE name = 'Die For You')), | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM track WHERE name = 'Dissolve')), | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM track WHERE name = 'NIGHT RIDER')), | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM track WHERE name = 'BLAHBLAHBLAH DEMO')), | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM track WHERE name = 'YUKON (INTERLUDE)')), | ||
((SELECT id FROM genre WHERE name = 'pop'), (SELECT id FROM track WHERE name = '1AM FREESTYLE')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM track WHERE name = 'Die For You')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM track WHERE name = 'Dissolve')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM track WHERE name = 'NIGHT RIDER')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM track WHERE name = 'BLAHBLAHBLAH DEMO')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM track WHERE name = 'YUKON (INTERLUDE)')), | ||
((SELECT id FROM genre WHERE name = 'hip-hop'), (SELECT id FROM track WHERE name = '1AM FREESTYLE')); | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
TRUNCATE TABLE artist CASCADE; | ||
TRUNCATE TABLE album CASCADE; | ||
TRUNCATE TABLE track CASCADE; | ||
TRUNCATE TABLE genre_artist CASCADE; | ||
TRUNCATE TABLE genre_track CASCADE; | ||
-- +goose StatementEnd |