Skip to content

Commit

Permalink
Merge pull request #24 from GenerateNU/rest_of_schema
Browse files Browse the repository at this point in the history
Rest of schema
  • Loading branch information
gaikwadsid authored Sep 23, 2024
2 parents f33718a + 22b4ed7 commit ec0ab7a
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
create table if not exists follower (
follower_id uuid not null references "user"(id),
followee_id uuid not null references "user"(id),
primary key (follower_id, followee_id)
);

create table if not exists playlist (
id serial primary key,
title text not null,
user_id uuid not null references "user"(id),
bio text,
cover_photo text
);

create table if not exists playlist_track (
playlist_id bigint not null references playlist(id),
track_id bigint not null references track(id),
primary key (playlist_id, track_id)
);

create table if not exists user_auth (
id serial primary key,
user_id uuid not null references "user"(id),
refresh_token text not null,
access_token text not null
);

create table if not exists user_review_vote (
user_id uuid not null references "user"(id),
review_id integer not null references review(id),
upvote boolean not null,
primary key (user_id, review_id)
);
38 changes: 37 additions & 1 deletion backend/internal/supabase/seed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,40 @@ VALUES
('2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e', 2, 'album', 4, 'I like this album.'),
('3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f', 1, 'track', 3, 'This song is okay.'),
('4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9d', 3, 'track', 2, 'I don''t like this song.'),
('4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9d', 5, 'track', 2, 'This song is the best song ever');
('4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9d', 5, 'track', 2, 'This song is the best song ever');

INSERT INTO follower (follower_id, followee_id)
VALUES
('1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d', '2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e'),
('2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e', '1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d'),
('3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f', '1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d');

INSERT INTO playlist (id, title, user_id, bio, cover_photo)
VALUES
(1, '2024', '1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d', 'Playlist for 2024', 'https://upload.wikimedia.org/wikipedia/commons/0/0a/Nils_B%C3%A4ckstr%C3%B6m_Rubin_Tyumen.jpg'),
(2, 'Movie Music', '1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d', 'Cinematic soundtracks and epic scores that bring the magic of movies to life.', 'https://upload.wikimedia.org/wikipedia/commons/thumb/1/13/Anolis_marmoratus%28fight%29.jpg/1280px-Anolis_marmoratus%28fight%29.jpg'),
(3, 'Chill Vibes', '2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e', 'High-energy tracks to power your workout sessions.', 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/f5/FOS244.jpg/1280px-FOS244.jpg'),
(4, 'Workout Mix', '3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f', 'A collection of nostalgic hits from past decades.', 'https://upload.wikimedia.org/wikipedia/commons/b/be/High_Airmass_Spectra_%28AuxTel-Feb%29.jpg'),
(5, 'Platnm', '5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9d0e', 'Playlist for the Platnm Team', 'https://upload.wikimedia.org/wikipedia/commons/thumb/d/d0/BCJMPort2017.jpg/1920px-BCJMPort2017.jpg');

INSERT INTO playlist_track (playlist_id, track_id)
VALUES
(1, 1),
(2, 2),
(3, 3);

INSERT INTO user_auth (id, user_id, refresh_token, access_token)
VALUES
(1, '1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d', 'refresh_token_abc123', 'access_token_xyz123'),
(2, '2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e', 'refresh_token_def456', 'access_token_uvw456'),
(3, '3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f', 'refresh_token_ghi789', 'access_token_rst789'),
(4, '4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9d', 'refresh_token_jkl012', 'access_token_opq012'),
(5, '5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9d0e', 'refresh_token_mno345', 'access_token_lmn345');

INSERT INTO user_review_vote (user_id, review_id, upvote)
VALUES
('1a2b3c4d-5e6f-7a8b-9c0d-1e2f3a4b5c6d', 1, true),
('2b3c4d5e-6f7a-8b9c-0d1e-2f3a4b5c6d7e', 2, false),
('3c4d5e6f-7a8b-9c0d-1e2f-3a4b5c6d7e8f', 3, false),
('4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9d', 4, false),
('5e6f7a8b-9c0d-1e2f-3a4b-5c6d7e8f9d0e', 5, true);

0 comments on commit ec0ab7a

Please sign in to comment.