Skip to content

Commit

Permalink
feat(playlist): Add DDL for playlist database schema
Browse files Browse the repository at this point in the history
  • Loading branch information
Likqez committed Nov 30, 2024
1 parent a8a731d commit d6f80fa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions DB/playlists.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
create table playlists
(
id text not null primary key,
"spotifyId" text not null,
name text not null,
cover text,
enabled boolean default false not null
);

CREATE UNIQUE INDEX enabled_playlist_unique_name ON playlists (name) WHERE enabled = true;

create table categories
(
name text not null,
"playlistId" text not null references playlists,
primary key (name, "playlistId")
);

0 comments on commit d6f80fa

Please sign in to comment.