From d6f80fa424b910881bed29840409f32283f1da4d Mon Sep 17 00:00:00 2001 From: Lukas Lanzner Date: Sat, 30 Nov 2024 13:05:24 +0100 Subject: [PATCH] feat(playlist): Add DDL for playlist database schema --- DB/playlists.sql | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 DB/playlists.sql diff --git a/DB/playlists.sql b/DB/playlists.sql new file mode 100644 index 0000000..9c39e60 --- /dev/null +++ b/DB/playlists.sql @@ -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") +);