diff --git a/.gitignore b/.gitignore index 8e44c14..be32812 100644 --- a/.gitignore +++ b/.gitignore @@ -45,9 +45,6 @@ bld/ *.dylib *.a -## migrations, they are autogenerated on build and publsish -*.sql - # Visual Studio 2015/2017 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot diff --git a/Console/Scripts/Migrations/2024081401_Initial.sql b/Console/Scripts/Migrations/2024081401_Initial.sql new file mode 100644 index 0000000..7ad4dfa --- /dev/null +++ b/Console/Scripts/Migrations/2024081401_Initial.sql @@ -0,0 +1,31 @@ +-- Create Settings table +CREATE TABLE IF NOT EXISTS Settings ( + Id INTEGER PRIMARY KEY AUTOINCREMENT, + Volume INTEGER NOT NULL +); + +-- Create Playlists table +CREATE TABLE IF NOT EXISTS Playlists ( + PlaylistId INTEGER PRIMARY KEY AUTOINCREMENT, + Name TEXT NOT NULL +); + +-- Create Songs table +CREATE TABLE IF NOT EXISTS Songs ( + Id TEXT PRIMARY KEY, + Title TEXT NOT NULL, + ChannelTitle TEXT, + ChannelId TEXT, + DurationMiliseconds REAL, + Url TEXT +); + +-- Create PlaylistSongs table +CREATE TABLE IF NOT EXISTS PlaylistSongs ( + PlaylistId INTEGER NOT NULL, + SongId TEXT NOT NULL, + [Order] INTEGER NOT NULL, + FOREIGN KEY (PlaylistId) REFERENCES Playlists (PlaylistId), + FOREIGN KEY (SongId) REFERENCES Songs (Id), + PRIMARY KEY (PlaylistId, SongId) +); \ No newline at end of file