diff --git a/.env.example b/.env.example
index 5021a686..4a85ca47 100644
--- a/.env.example
+++ b/.env.example
@@ -1,7 +1,13 @@
TVDB__APIKEY=
THEMOVIEDB__APIKEY=
AUTHENTICATION_SECRET=
-POSTGRES_USER=kyoousername
-POSTGRES_PASSWORD=kyoopassword
-POSTGRES_DB=kyooDB
PUBLIC_BACK_URL=http://localhost:5000
+
+# Database things (optional)
+POSTGRES_USER=KyooUser
+POSTGRES_PASSWORD=KyooPassword
+POSTGRES_DB=kyooDB
+POSTGRES_SERVER=postgres
+POSTGRES_PORT=5432
+
+# vi: ft=sh
diff --git a/back/Kyoo.sln b/back/Kyoo.sln
index 9ebdae65..6a618cb7 100644
--- a/back/Kyoo.sln
+++ b/back/Kyoo.sln
@@ -3,14 +3,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kyoo.Core", "src\Kyoo.Core\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.Abstractions", "src\Kyoo.Abstractions\Kyoo.Abstractions.csproj", "{BAB2CAE1-AC28-4509-AA3E-8DC75BD59220}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.Database", "src\Kyoo.Database\Kyoo.Database.csproj", "{6F91B645-F785-46BB-9C4F-1EFC83E489B6}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.Postgresql", "src\Kyoo.Postgresql\Kyoo.Postgresql.csproj", "{3213C96D-0BF3-460B-A8B5-B9977229408A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.Authentication", "src\Kyoo.Authentication\Kyoo.Authentication.csproj", "{7A841335-6523-47DB-9717-80AA7BD943FD}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.SqLite", "src\Kyoo.SqLite\Kyoo.SqLite.csproj", "{6515380E-1E57-42DA-B6E3-E1C8A848818A}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.TheTvdb", "src\Kyoo.TheTvdb\Kyoo.TheTvdb.csproj", "{D06BF829-23F5-40F3-A62D-627D9F4B4D6C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kyoo.TheMovieDb", "src\Kyoo.TheMovieDb\Kyoo.TheMovieDb.csproj", "{BAB270D4-E0EA-4329-BA65-512FDAB01001}"
@@ -45,10 +41,6 @@ Global
{BAB2CAE1-AC28-4509-AA3E-8DC75BD59220}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAB2CAE1-AC28-4509-AA3E-8DC75BD59220}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAB2CAE1-AC28-4509-AA3E-8DC75BD59220}.Release|Any CPU.Build.0 = Release|Any CPU
- {6F91B645-F785-46BB-9C4F-1EFC83E489B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6F91B645-F785-46BB-9C4F-1EFC83E489B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6F91B645-F785-46BB-9C4F-1EFC83E489B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6F91B645-F785-46BB-9C4F-1EFC83E489B6}.Release|Any CPU.Build.0 = Release|Any CPU
{3213C96D-0BF3-460B-A8B5-B9977229408A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3213C96D-0BF3-460B-A8B5-B9977229408A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3213C96D-0BF3-460B-A8B5-B9977229408A}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -98,7 +90,6 @@ Global
{0C8AA7EA-E723-4532-852F-35AA4E8AFED5} = {FEAE1B0E-D797-470F-9030-0EF743575ECC}
{BAB270D4-E0EA-4329-BA65-512FDAB01001} = {8D28F5EF-0CD7-4697-A2A7-24EC31A48F21}
{D06BF829-23F5-40F3-A62D-627D9F4B4D6C} = {8D28F5EF-0CD7-4697-A2A7-24EC31A48F21}
- {6F91B645-F785-46BB-9C4F-1EFC83E489B6} = {865461CA-EC06-4B42-91CF-8723B0A9BB67}
{3213C96D-0BF3-460B-A8B5-B9977229408A} = {865461CA-EC06-4B42-91CF-8723B0A9BB67}
{6515380E-1E57-42DA-B6E3-E1C8A848818A} = {865461CA-EC06-4B42-91CF-8723B0A9BB67}
{D8658BEA-8949-45AC-BEBB-A4FFC4F800F5} = {C569FF25-7E01-484C-9F72-5B99845AD94B}
diff --git a/back/src/Kyoo.Core/Controllers/PassthroughPermissionValidator.cs b/back/src/Kyoo.Core/Controllers/PassthroughPermissionValidator.cs
deleted file mode 100644
index 2c5ae6aa..00000000
--- a/back/src/Kyoo.Core/Controllers/PassthroughPermissionValidator.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-// Kyoo - A portable and vast media library solution.
-// Copyright (c) Kyoo.
-//
-// See AUTHORS.md and LICENSE file in the project root for full license information.
-//
-// Kyoo is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// any later version.
-//
-// Kyoo is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Kyoo. If not, see .
-
-using System.Diagnostics.CodeAnalysis;
-using Kyoo.Abstractions.Controllers;
-using Kyoo.Abstractions.Models.Permissions;
-using Microsoft.AspNetCore.Mvc.Filters;
-using Microsoft.Extensions.Logging;
-
-namespace Kyoo.Core.Controllers
-{
- ///
- /// A permission validator that always validate permissions. This effectively disable the permission system.
- ///
- public class PassthroughPermissionValidator : IPermissionValidator
- {
- ///
- /// Create a new .
- ///
- /// The logger used to warn that no real permission validator exists.
- [SuppressMessage("ReSharper", "SuggestBaseTypeForParameterInConstructor",
- Justification = "ILogger should include the typeparam for context.")]
- public PassthroughPermissionValidator(ILogger logger)
- {
- logger.LogWarning("No permission validator has been enabled, all users will have all permissions");
- }
-
- ///
- public IFilterMetadata Create(PermissionAttribute attribute)
- {
- return new PassthroughValidator();
- }
-
- ///
- public IFilterMetadata Create(PartialPermissionAttribute attribute)
- {
- return new PassthroughValidator();
- }
-
- ///
- /// An useless filter that does nothing.
- ///
- private class PassthroughValidator : IFilterMetadata { }
- }
-}
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/CollectionRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/CollectionRepository.cs
index 0e6f4daa..840fbffd 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/CollectionRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/CollectionRepository.cs
@@ -22,7 +22,7 @@ using System.Linq;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/EpisodeRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/EpisodeRepository.cs
index 64650cf4..0bc73f6b 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/EpisodeRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/EpisodeRepository.cs
@@ -23,7 +23,7 @@ using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
using Kyoo.Abstractions.Models.Exceptions;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Kyoo.Utils;
using Microsoft.EntityFrameworkCore;
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/GenreRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/GenreRepository.cs
index 5c7a070b..2ada5abc 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/GenreRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/GenreRepository.cs
@@ -19,11 +19,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs
index 61ecc099..a9b15fb5 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/LibraryItemRepository.cs
@@ -24,7 +24,7 @@ using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
using Kyoo.Abstractions.Models.Exceptions;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/LibraryRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/LibraryRepository.cs
index 5177e120..c9987a3b 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/LibraryRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/LibraryRepository.cs
@@ -19,11 +19,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Kyoo.Utils;
using Microsoft.EntityFrameworkCore;
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs
index d14f0048..70a06b3d 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/PeopleRepository.cs
@@ -23,8 +23,7 @@ using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Abstractions.Models.Exceptions;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Kyoo.Utils;
using Microsoft.EntityFrameworkCore;
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/ProviderRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/ProviderRepository.cs
index 08389693..5aa2d0be 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/ProviderRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/ProviderRepository.cs
@@ -23,7 +23,7 @@ using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/SeasonRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/SeasonRepository.cs
index 7dcd9845..8dc193c5 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/SeasonRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/SeasonRepository.cs
@@ -19,12 +19,11 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
using Kyoo.Abstractions.Models.Exceptions;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs
index a2d26da1..14802bea 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/ShowRepository.cs
@@ -16,14 +16,12 @@
// You should have received a copy of the GNU General Public License
// along with Kyoo. If not, see .
-using System;
using System.Collections.Generic;
using System.Linq;
-using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Kyoo.Utils;
using Microsoft.EntityFrameworkCore;
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/StudioRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/StudioRepository.cs
index 3c4acc3a..78cccbdb 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/StudioRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/StudioRepository.cs
@@ -19,11 +19,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/TrackRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/TrackRepository.cs
index 2528fc2b..4c55cc47 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/TrackRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/TrackRepository.cs
@@ -21,7 +21,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/Controllers/Repositories/UserRepository.cs b/back/src/Kyoo.Core/Controllers/Repositories/UserRepository.cs
index 68835752..0ff386e5 100644
--- a/back/src/Kyoo.Core/Controllers/Repositories/UserRepository.cs
+++ b/back/src/Kyoo.Core/Controllers/Repositories/UserRepository.cs
@@ -19,11 +19,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
-using System.Linq.Expressions;
using System.Threading.Tasks;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
+using Kyoo.Postgresql;
using Microsoft.EntityFrameworkCore;
namespace Kyoo.Core.Controllers
diff --git a/back/src/Kyoo.Core/CoreModule.cs b/back/src/Kyoo.Core/CoreModule.cs
index 9b775511..3366c80b 100644
--- a/back/src/Kyoo.Core/CoreModule.cs
+++ b/back/src/Kyoo.Core/CoreModule.cs
@@ -20,15 +20,12 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Autofac;
-using Autofac.Core;
-using Autofac.Core.Registration;
using Kyoo.Abstractions;
using Kyoo.Abstractions.Controllers;
using Kyoo.Abstractions.Models.Utils;
using Kyoo.Core.Controllers;
using Kyoo.Core.Models.Options;
using Kyoo.Core.Tasks;
-using Kyoo.Database;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Routing;
@@ -85,24 +82,18 @@ namespace Kyoo.Core
builder.RegisterTask();
builder.RegisterTask();
- static bool DatabaseIsPresent(IComponentRegistryBuilder x)
- => x.IsRegistered(new TypedService(typeof(DatabaseContext)));
-
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
- builder.RegisterRepository().OnlyIf(DatabaseIsPresent);
-
- builder.RegisterType().As()
- .IfNotRegistered(typeof(IPermissionValidator));
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
+ builder.RegisterRepository();
builder.RegisterType().As().SingleInstance()
.OnActivating(x =>
diff --git a/back/src/Kyoo.Core/Kyoo.Core.csproj b/back/src/Kyoo.Core/Kyoo.Core.csproj
index 740fff1e..8f113039 100644
--- a/back/src/Kyoo.Core/Kyoo.Core.csproj
+++ b/back/src/Kyoo.Core/Kyoo.Core.csproj
@@ -19,7 +19,7 @@
-
+
diff --git a/back/src/Kyoo.Database/Extensions.cs b/back/src/Kyoo.Database/Extensions.cs
deleted file mode 100644
index f7f75850..00000000
--- a/back/src/Kyoo.Database/Extensions.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-// Kyoo - A portable and vast media library solution.
-// Copyright (c) Kyoo.
-//
-// See AUTHORS.md and LICENSE file in the project root for full license information.
-//
-// Kyoo is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// any later version.
-//
-// Kyoo is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Kyoo. If not, see .
-
-using System.Data.Common;
-using Microsoft.Extensions.Configuration;
-
-namespace Kyoo.Database
-{
- ///
- /// A class that regroup extensions used by some asp-net related parts of the app.
- ///
- public static class Extensions
- {
- ///
- /// Get a connection string from the Configuration's section "Database"
- ///
- /// The IConfiguration instance to use.
- /// The database's name.
- /// A parsed connection string
- public static string GetDatabaseConnection(this IConfiguration config, string database)
- {
- static string ToDbProperty(string key)
- {
- return key.ToUpperInvariant() switch
- {
- "USER" => "USER ID",
- _ => key
- };
- }
-
- DbConnectionStringBuilder builder = new();
- IConfigurationSection section = config.GetSection("database:configurations").GetSection(database);
- foreach (IConfigurationSection child in section.GetChildren())
- {
- builder[ToDbProperty(child.Key)] = child.Value;
- }
- return builder.ConnectionString;
- }
-
- ///
- /// Get the name of the selected database.
- ///
- /// The IConfiguration instance to use.
- /// The name of the selected database.
- public static string GetSelectedDatabase(this IConfiguration config)
- {
- return config.GetValue("database:enabled");
- }
- }
-}
diff --git a/back/src/Kyoo.Database/Kyoo.Database.csproj b/back/src/Kyoo.Database/Kyoo.Database.csproj
deleted file mode 100644
index b02d0279..00000000
--- a/back/src/Kyoo.Database/Kyoo.Database.csproj
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- Kyoo.Database
- Kyoo.Database
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/back/src/Kyoo.Host.Generic/Application.cs b/back/src/Kyoo.Host.Generic/Application.cs
index 62cca55e..cb1e0f9b 100644
--- a/back/src/Kyoo.Host.Generic/Application.cs
+++ b/back/src/Kyoo.Host.Generic/Application.cs
@@ -17,7 +17,6 @@
// along with Kyoo. If not, see .
using System;
-using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Threading;
@@ -32,7 +31,6 @@ using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Hosting.Systemd;
using Microsoft.Extensions.Logging;
-using Microsoft.Win32;
using Serilog;
using Serilog.Templates;
using Serilog.Templates.Themes;
diff --git a/back/src/Kyoo.Host.Generic/PluginsStartup.cs b/back/src/Kyoo.Host.Generic/PluginsStartup.cs
index a5707773..63bc88cc 100644
--- a/back/src/Kyoo.Host.Generic/PluginsStartup.cs
+++ b/back/src/Kyoo.Host.Generic/PluginsStartup.cs
@@ -27,7 +27,6 @@ using Kyoo.Core;
using Kyoo.Core.Models.Options;
using Kyoo.Host.Generic.Controllers;
using Kyoo.Postgresql;
-using Kyoo.SqLite;
using Kyoo.Swagger;
using Kyoo.TheMovieDb;
using Kyoo.TheTvdb;
@@ -78,7 +77,6 @@ namespace Kyoo.Host.Generic
typeof(CoreModule),
typeof(AuthenticationModule),
typeof(PostgresModule),
- typeof(SqLiteModule),
typeof(PluginTvdb),
typeof(PluginTmdb),
typeof(SwaggerModule)
diff --git a/back/src/Kyoo.Host.Generic/settings.json b/back/src/Kyoo.Host.Generic/settings.json
index 842060f6..0d5390cf 100644
--- a/back/src/Kyoo.Host.Generic/settings.json
+++ b/back/src/Kyoo.Host.Generic/settings.json
@@ -7,26 +7,6 @@
"metadataPath": "metadata/"
},
- "database": {
- "enabled": "sqlite",
- "configurations": {
- "sqlite": {
- "data Source": "kyoo.db",
- "cache": "Shared"
- },
- "postgres": {
- "server": "127.0.0.1",
- "port": "5432",
- "database": "kyooDB",
- "user": "kyoo",
- "password": "kyooPassword",
- "pooling": "true",
- "maxPoolSize": "95",
- "timeout": "30"
- }
- }
- },
-
"logging": {
"MinimumLevel": {
"Default": "Warning",
diff --git a/back/src/Kyoo.Database/DatabaseContext.cs b/back/src/Kyoo.Postgresql/DatabaseContext.cs
similarity index 99%
rename from back/src/Kyoo.Database/DatabaseContext.cs
rename to back/src/Kyoo.Postgresql/DatabaseContext.cs
index 12cb22d4..fb3886df 100644
--- a/back/src/Kyoo.Database/DatabaseContext.cs
+++ b/back/src/Kyoo.Postgresql/DatabaseContext.cs
@@ -29,7 +29,7 @@ using Kyoo.Abstractions.Models.Exceptions;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.ChangeTracking;
-namespace Kyoo.Database
+namespace Kyoo.Postgresql
{
///
/// The database handle used for all local repositories.
diff --git a/back/src/Kyoo.Postgresql/Kyoo.Postgresql.csproj b/back/src/Kyoo.Postgresql/Kyoo.Postgresql.csproj
index 85ce27db..442c8c8f 100644
--- a/back/src/Kyoo.Postgresql/Kyoo.Postgresql.csproj
+++ b/back/src/Kyoo.Postgresql/Kyoo.Postgresql.csproj
@@ -11,10 +11,10 @@
runtime; build; native; contentfiles; analyzers; buildtransitive
+
-
diff --git a/back/src/Kyoo.Postgresql/PostgresContext.cs b/back/src/Kyoo.Postgresql/PostgresContext.cs
index ee29d437..49ecf3ce 100644
--- a/back/src/Kyoo.Postgresql/PostgresContext.cs
+++ b/back/src/Kyoo.Postgresql/PostgresContext.cs
@@ -22,7 +22,6 @@ using System.Linq.Expressions;
using System.Reflection;
using EFCore.NamingConventions.Internal;
using Kyoo.Abstractions.Models;
-using Kyoo.Database;
using Kyoo.Utils;
using Microsoft.EntityFrameworkCore;
using Npgsql;
diff --git a/back/src/Kyoo.Postgresql/PostgresModule.cs b/back/src/Kyoo.Postgresql/PostgresModule.cs
index ebe200eb..fbcb3bfa 100644
--- a/back/src/Kyoo.Postgresql/PostgresModule.cs
+++ b/back/src/Kyoo.Postgresql/PostgresModule.cs
@@ -18,8 +18,8 @@
using System;
using System.Collections.Generic;
+using System.Data.Common;
using Kyoo.Abstractions.Controllers;
-using Kyoo.Database;
using Microsoft.AspNetCore.Hosting;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
@@ -47,7 +47,7 @@ namespace Kyoo.Postgresql
public Dictionary Configuration => new();
///
- public bool Enabled => _configuration.GetSelectedDatabase() == "postgres";
+ public bool Enabled => true;
///
/// The configuration to use. The database connection string is pulled from it.
@@ -75,7 +75,18 @@ namespace Kyoo.Postgresql
{
services.AddDbContext(x =>
{
- x.UseNpgsql(_configuration.GetDatabaseConnection("postgres"));
+ DbConnectionStringBuilder builder = new()
+ {
+ ["USER ID"] = _configuration.GetValue("POSTGRES_USER", "KyooUser"),
+ ["PASSWORD"] = _configuration.GetValue("POSTGRES_PASSWORD", "KyooPassword"),
+ ["SERVER"] = _configuration.GetValue("POSTGRES_SERVER", "db"),
+ ["PORT"] = _configuration.GetValue("POSTGRES_PORT", "5432"),
+ ["DATABASE"] = _configuration.GetValue("POSTGRES_DB", "kyooDB"),
+ ["POOLING"] = "true",
+ ["MAXPOOLSIZE"] = "95",
+ ["TIMEOUT"] = "30"
+ };
+ x.UseNpgsql(builder.ConnectionString);
if (_environment.IsDevelopment())
x.EnableDetailedErrors().EnableSensitiveDataLogging();
}, ServiceLifetime.Transient);
diff --git a/back/src/Kyoo.SqLite/Kyoo.SqLite.csproj b/back/src/Kyoo.SqLite/Kyoo.SqLite.csproj
deleted file mode 100644
index b999e5f6..00000000
--- a/back/src/Kyoo.SqLite/Kyoo.SqLite.csproj
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
- Kyoo.SqLite
- Kyoo.SqLite
-
-
-
-
- all
- runtime; build; native; contentfiles; analyzers; buildtransitive
-
-
-
-
-
-
diff --git a/back/src/Kyoo.SqLite/Migrations/20210801171534_Initial.Designer.cs b/back/src/Kyoo.SqLite/Migrations/20210801171534_Initial.Designer.cs
deleted file mode 100644
index e912d60a..00000000
--- a/back/src/Kyoo.SqLite/Migrations/20210801171534_Initial.Designer.cs
+++ /dev/null
@@ -1,1020 +0,0 @@
-//
-using System;
-using Kyoo.SqLite;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-namespace Kyoo.SqLite.Migrations
-{
- [DbContext(typeof(SqLiteContext))]
- [Migration("20210801171534_Initial")]
- partial class Initial
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "5.0.8");
-
- modelBuilder.Entity("CollectionMetadataID", b =>
- {
- b.Property("ResourceID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.Property("DataID")
- .HasColumnType("TEXT");
-
- b.Property("Link")
- .HasColumnType("TEXT");
-
- b.HasKey("ResourceID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("CollectionMetadataID");
- });
-
- modelBuilder.Entity("EpisodeMetadataID", b =>
- {
- b.Property("ResourceID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.Property("DataID")
- .HasColumnType("TEXT");
-
- b.Property("Link")
- .HasColumnType("TEXT");
-
- b.HasKey("ResourceID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("EpisodeMetadataID");
- });
-
- modelBuilder.Entity("Kyoo.Models.Collection", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Overview")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Collections");
- });
-
- modelBuilder.Entity("Kyoo.Models.Episode", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("AbsoluteNumber")
- .HasColumnType("INTEGER");
-
- b.Property("EpisodeNumber")
- .HasColumnType("INTEGER");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Overview")
- .HasColumnType("TEXT");
-
- b.Property("Path")
- .HasColumnType("TEXT");
-
- b.Property("ReleaseDate")
- .HasColumnType("TEXT");
-
- b.Property("SeasonID")
- .HasColumnType("INTEGER");
-
- b.Property("SeasonNumber")
- .HasColumnType("INTEGER");
-
- b.Property("ShowID")
- .HasColumnType("INTEGER");
-
- b.Property("Slug")
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("TEXT");
-
- b.Property("Title")
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("SeasonID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.HasIndex("ShowID", "SeasonNumber", "EpisodeNumber", "AbsoluteNumber")
- .IsUnique();
-
- b.ToTable("Episodes");
- });
-
- modelBuilder.Entity("Kyoo.Models.Genre", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Genres");
- });
-
- modelBuilder.Entity("Kyoo.Models.Library", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Paths")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Libraries");
- });
-
- modelBuilder.Entity("Kyoo.Models.LibraryItem", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("EndAir")
- .HasColumnType("TEXT");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Overview")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .HasColumnType("TEXT");
-
- b.Property("StartAir")
- .HasColumnType("TEXT");
-
- b.Property("Status")
- .HasColumnType("INTEGER");
-
- b.Property("Title")
- .HasColumnType("TEXT");
-
- b.Property("Type")
- .HasColumnType("INTEGER");
-
- b.HasKey("ID");
-
- b.ToView("LibraryItems");
- });
-
- modelBuilder.Entity("Kyoo.Models.People", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("People");
- });
-
- modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("PeopleID")
- .HasColumnType("INTEGER");
-
- b.Property("Role")
- .HasColumnType("TEXT");
-
- b.Property("ShowID")
- .HasColumnType("INTEGER");
-
- b.Property("Type")
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("PeopleID");
-
- b.HasIndex("ShowID");
-
- b.ToTable("PeopleRoles");
- });
-
- modelBuilder.Entity("Kyoo.Models.Provider", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Providers");
- });
-
- modelBuilder.Entity("Kyoo.Models.Season", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("EndDate")
- .HasColumnType("TEXT");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Overview")
- .HasColumnType("TEXT");
-
- b.Property("SeasonNumber")
- .HasColumnType("INTEGER");
-
- b.Property("ShowID")
- .HasColumnType("INTEGER");
-
- b.Property("Slug")
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("TEXT");
-
- b.Property("StartDate")
- .HasColumnType("TEXT");
-
- b.Property("Title")
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.HasIndex("ShowID", "SeasonNumber")
- .IsUnique();
-
- b.ToTable("Seasons");
- });
-
- modelBuilder.Entity("Kyoo.Models.Show", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Aliases")
- .HasColumnType("TEXT");
-
- b.Property("EndAir")
- .HasColumnType("TEXT");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("IsMovie")
- .HasColumnType("INTEGER");
-
- b.Property("Overview")
- .HasColumnType("TEXT");
-
- b.Property("Path")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property("StartAir")
- .HasColumnType("TEXT");
-
- b.Property("Status")
- .HasColumnType("INTEGER");
-
- b.Property("StudioID")
- .HasColumnType("INTEGER");
-
- b.Property("Title")
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.HasIndex("StudioID");
-
- b.ToTable("Shows");
- });
-
- modelBuilder.Entity("Kyoo.Models.Studio", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Name")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Studios");
- });
-
- modelBuilder.Entity("Kyoo.Models.Track", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Codec")
- .HasColumnType("TEXT");
-
- b.Property("EpisodeID")
- .HasColumnType("INTEGER");
-
- b.Property("IsDefault")
- .HasColumnType("INTEGER");
-
- b.Property("IsExternal")
- .HasColumnType("INTEGER");
-
- b.Property("IsForced")
- .HasColumnType("INTEGER");
-
- b.Property("Language")
- .HasColumnType("TEXT");
-
- b.Property("Path")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .ValueGeneratedOnAddOrUpdate()
- .HasColumnType("TEXT");
-
- b.Property("Title")
- .HasColumnType("TEXT");
-
- b.Property("TrackIndex")
- .HasColumnType("INTEGER");
-
- b.Property("Type")
- .HasColumnType("INTEGER");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.HasIndex("EpisodeID", "Type", "Language", "TrackIndex", "IsForced")
- .IsUnique();
-
- b.ToTable("Tracks");
- });
-
- modelBuilder.Entity("Kyoo.Models.User", b =>
- {
- b.Property("ID")
- .ValueGeneratedOnAdd()
- .HasColumnType("INTEGER");
-
- b.Property("Email")
- .HasColumnType("TEXT");
-
- b.Property("ExtraData")
- .HasColumnType("TEXT");
-
- b.Property("Images")
- .HasColumnType("TEXT");
-
- b.Property("Password")
- .HasColumnType("TEXT");
-
- b.Property("Permissions")
- .HasColumnType("TEXT");
-
- b.Property("Slug")
- .IsRequired()
- .HasColumnType("TEXT");
-
- b.Property("Username")
- .HasColumnType("TEXT");
-
- b.HasKey("ID");
-
- b.HasIndex("Slug")
- .IsUnique();
-
- b.ToTable("Users");
- });
-
- modelBuilder.Entity("Kyoo.Models.WatchedEpisode", b =>
- {
- b.Property("UserID")
- .HasColumnType("INTEGER");
-
- b.Property("EpisodeID")
- .HasColumnType("INTEGER");
-
- b.Property("WatchedPercentage")
- .HasColumnType("INTEGER");
-
- b.HasKey("UserID", "EpisodeID");
-
- b.HasIndex("EpisodeID");
-
- b.ToTable("WatchedEpisodes");
- });
-
- modelBuilder.Entity("LinkCollectionShow", b =>
- {
- b.Property("CollectionID")
- .HasColumnType("INTEGER");
-
- b.Property("ShowID")
- .HasColumnType("INTEGER");
-
- b.HasKey("CollectionID", "ShowID");
-
- b.HasIndex("ShowID");
-
- b.ToTable("LinkCollectionShow");
- });
-
- modelBuilder.Entity("LinkLibraryCollection", b =>
- {
- b.Property("CollectionID")
- .HasColumnType("INTEGER");
-
- b.Property("LibraryID")
- .HasColumnType("INTEGER");
-
- b.HasKey("CollectionID", "LibraryID");
-
- b.HasIndex("LibraryID");
-
- b.ToTable("LinkLibraryCollection");
- });
-
- modelBuilder.Entity("LinkLibraryProvider", b =>
- {
- b.Property("LibraryID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.HasKey("LibraryID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("LinkLibraryProvider");
- });
-
- modelBuilder.Entity("LinkLibraryShow", b =>
- {
- b.Property("LibraryID")
- .HasColumnType("INTEGER");
-
- b.Property("ShowID")
- .HasColumnType("INTEGER");
-
- b.HasKey("LibraryID", "ShowID");
-
- b.HasIndex("ShowID");
-
- b.ToTable("LinkLibraryShow");
- });
-
- modelBuilder.Entity("LinkShowGenre", b =>
- {
- b.Property("GenreID")
- .HasColumnType("INTEGER");
-
- b.Property("ShowID")
- .HasColumnType("INTEGER");
-
- b.HasKey("GenreID", "ShowID");
-
- b.HasIndex("ShowID");
-
- b.ToTable("LinkShowGenre");
- });
-
- modelBuilder.Entity("PeopleMetadataID", b =>
- {
- b.Property("ResourceID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.Property("DataID")
- .HasColumnType("TEXT");
-
- b.Property("Link")
- .HasColumnType("TEXT");
-
- b.HasKey("ResourceID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("PeopleMetadataID");
- });
-
- modelBuilder.Entity("SeasonMetadataID", b =>
- {
- b.Property("ResourceID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.Property("DataID")
- .HasColumnType("TEXT");
-
- b.Property("Link")
- .HasColumnType("TEXT");
-
- b.HasKey("ResourceID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("SeasonMetadataID");
- });
-
- modelBuilder.Entity("ShowMetadataID", b =>
- {
- b.Property("ResourceID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.Property("DataID")
- .HasColumnType("TEXT");
-
- b.Property("Link")
- .HasColumnType("TEXT");
-
- b.HasKey("ResourceID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("ShowMetadataID");
- });
-
- modelBuilder.Entity("ShowUser", b =>
- {
- b.Property("UsersID")
- .HasColumnType("INTEGER");
-
- b.Property("WatchedID")
- .HasColumnType("INTEGER");
-
- b.HasKey("UsersID", "WatchedID");
-
- b.HasIndex("WatchedID");
-
- b.ToTable("LinkUserShow");
- });
-
- modelBuilder.Entity("StudioMetadataID", b =>
- {
- b.Property("ResourceID")
- .HasColumnType("INTEGER");
-
- b.Property("ProviderID")
- .HasColumnType("INTEGER");
-
- b.Property("DataID")
- .HasColumnType("TEXT");
-
- b.Property("Link")
- .HasColumnType("TEXT");
-
- b.HasKey("ResourceID", "ProviderID");
-
- b.HasIndex("ProviderID");
-
- b.ToTable("StudioMetadataID");
- });
-
- modelBuilder.Entity("CollectionMetadataID", b =>
- {
- b.HasOne("Kyoo.Models.Provider", "Provider")
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Collection", null)
- .WithMany("ExternalIDs")
- .HasForeignKey("ResourceID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Provider");
- });
-
- modelBuilder.Entity("EpisodeMetadataID", b =>
- {
- b.HasOne("Kyoo.Models.Provider", "Provider")
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Episode", null)
- .WithMany("ExternalIDs")
- .HasForeignKey("ResourceID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Provider");
- });
-
- modelBuilder.Entity("Kyoo.Models.Episode", b =>
- {
- b.HasOne("Kyoo.Models.Season", "Season")
- .WithMany("Episodes")
- .HasForeignKey("SeasonID")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("Kyoo.Models.Show", "Show")
- .WithMany("Episodes")
- .HasForeignKey("ShowID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Season");
-
- b.Navigation("Show");
- });
-
- modelBuilder.Entity("Kyoo.Models.PeopleRole", b =>
- {
- b.HasOne("Kyoo.Models.People", "People")
- .WithMany("Roles")
- .HasForeignKey("PeopleID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Show", "Show")
- .WithMany("People")
- .HasForeignKey("ShowID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("People");
-
- b.Navigation("Show");
- });
-
- modelBuilder.Entity("Kyoo.Models.Season", b =>
- {
- b.HasOne("Kyoo.Models.Show", "Show")
- .WithMany("Seasons")
- .HasForeignKey("ShowID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Show");
- });
-
- modelBuilder.Entity("Kyoo.Models.Show", b =>
- {
- b.HasOne("Kyoo.Models.Studio", "Studio")
- .WithMany("Shows")
- .HasForeignKey("StudioID")
- .OnDelete(DeleteBehavior.SetNull);
-
- b.Navigation("Studio");
- });
-
- modelBuilder.Entity("Kyoo.Models.Track", b =>
- {
- b.HasOne("Kyoo.Models.Episode", "Episode")
- .WithMany("Tracks")
- .HasForeignKey("EpisodeID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Episode");
- });
-
- modelBuilder.Entity("Kyoo.Models.WatchedEpisode", b =>
- {
- b.HasOne("Kyoo.Models.Episode", "Episode")
- .WithMany()
- .HasForeignKey("EpisodeID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.User", null)
- .WithMany("CurrentlyWatching")
- .HasForeignKey("UserID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Episode");
- });
-
- modelBuilder.Entity("LinkCollectionShow", b =>
- {
- b.HasOne("Kyoo.Models.Collection", null)
- .WithMany()
- .HasForeignKey("CollectionID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Show", null)
- .WithMany()
- .HasForeignKey("ShowID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("LinkLibraryCollection", b =>
- {
- b.HasOne("Kyoo.Models.Collection", null)
- .WithMany()
- .HasForeignKey("CollectionID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Library", null)
- .WithMany()
- .HasForeignKey("LibraryID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("LinkLibraryProvider", b =>
- {
- b.HasOne("Kyoo.Models.Library", null)
- .WithMany()
- .HasForeignKey("LibraryID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Provider", null)
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("LinkLibraryShow", b =>
- {
- b.HasOne("Kyoo.Models.Library", null)
- .WithMany()
- .HasForeignKey("LibraryID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Show", null)
- .WithMany()
- .HasForeignKey("ShowID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("LinkShowGenre", b =>
- {
- b.HasOne("Kyoo.Models.Genre", null)
- .WithMany()
- .HasForeignKey("GenreID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Show", null)
- .WithMany()
- .HasForeignKey("ShowID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("PeopleMetadataID", b =>
- {
- b.HasOne("Kyoo.Models.Provider", "Provider")
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.People", null)
- .WithMany("ExternalIDs")
- .HasForeignKey("ResourceID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Provider");
- });
-
- modelBuilder.Entity("SeasonMetadataID", b =>
- {
- b.HasOne("Kyoo.Models.Provider", "Provider")
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Season", null)
- .WithMany("ExternalIDs")
- .HasForeignKey("ResourceID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Provider");
- });
-
- modelBuilder.Entity("ShowMetadataID", b =>
- {
- b.HasOne("Kyoo.Models.Provider", "Provider")
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Show", null)
- .WithMany("ExternalIDs")
- .HasForeignKey("ResourceID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Provider");
- });
-
- modelBuilder.Entity("ShowUser", b =>
- {
- b.HasOne("Kyoo.Models.User", null)
- .WithMany()
- .HasForeignKey("UsersID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Show", null)
- .WithMany()
- .HasForeignKey("WatchedID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
- });
-
- modelBuilder.Entity("StudioMetadataID", b =>
- {
- b.HasOne("Kyoo.Models.Provider", "Provider")
- .WithMany()
- .HasForeignKey("ProviderID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("Kyoo.Models.Studio", null)
- .WithMany("ExternalIDs")
- .HasForeignKey("ResourceID")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Provider");
- });
-
- modelBuilder.Entity("Kyoo.Models.Collection", b =>
- {
- b.Navigation("ExternalIDs");
- });
-
- modelBuilder.Entity("Kyoo.Models.Episode", b =>
- {
- b.Navigation("ExternalIDs");
-
- b.Navigation("Tracks");
- });
-
- modelBuilder.Entity("Kyoo.Models.People", b =>
- {
- b.Navigation("ExternalIDs");
-
- b.Navigation("Roles");
- });
-
- modelBuilder.Entity("Kyoo.Models.Season", b =>
- {
- b.Navigation("Episodes");
-
- b.Navigation("ExternalIDs");
- });
-
- modelBuilder.Entity("Kyoo.Models.Show", b =>
- {
- b.Navigation("Episodes");
-
- b.Navigation("ExternalIDs");
-
- b.Navigation("People");
-
- b.Navigation("Seasons");
- });
-
- modelBuilder.Entity("Kyoo.Models.Studio", b =>
- {
- b.Navigation("ExternalIDs");
-
- b.Navigation("Shows");
- });
-
- modelBuilder.Entity("Kyoo.Models.User", b =>
- {
- b.Navigation("CurrentlyWatching");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/back/src/Kyoo.SqLite/Migrations/20210801171534_Initial.cs b/back/src/Kyoo.SqLite/Migrations/20210801171534_Initial.cs
deleted file mode 100644
index 985f0409..00000000
--- a/back/src/Kyoo.SqLite/Migrations/20210801171534_Initial.cs
+++ /dev/null
@@ -1,861 +0,0 @@
-// Kyoo - A portable and vast media library solution.
-// Copyright (c) Kyoo.
-//
-// See AUTHORS.md and LICENSE file in the project root for full license information.
-//
-// Kyoo is free software: you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation, either version 3 of the License, or
-// any later version.
-//
-// Kyoo is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with Kyoo. If not, see .
-
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-namespace Kyoo.SqLite.Migrations
-{
- ///
- /// The initial migration that build most of the database.
- ///
- public partial class Initial : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Collections",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Collections", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Genres",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Genres", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Libraries",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Paths = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Libraries", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "People",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_People", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Providers",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Providers", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Studios",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Name = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Studios", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "Users",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Username = table.Column(type: "TEXT", nullable: true),
- Email = table.Column(type: "TEXT", nullable: true),
- Password = table.Column(type: "TEXT", nullable: true),
- Permissions = table.Column(type: "TEXT", nullable: true),
- ExtraData = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Users", x => x.ID);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkLibraryCollection",
- columns: table => new
- {
- CollectionID = table.Column(type: "INTEGER", nullable: false),
- LibraryID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkLibraryCollection", x => new { x.CollectionID, x.LibraryID });
- table.ForeignKey(
- name: "FK_LinkLibraryCollection_Collections_CollectionID",
- column: x => x.CollectionID,
- principalTable: "Collections",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkLibraryCollection_Libraries_LibraryID",
- column: x => x.LibraryID,
- principalTable: "Libraries",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "CollectionMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_CollectionMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_CollectionMetadataID_Collections_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Collections",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_CollectionMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkLibraryProvider",
- columns: table => new
- {
- LibraryID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkLibraryProvider", x => new { x.LibraryID, x.ProviderID });
- table.ForeignKey(
- name: "FK_LinkLibraryProvider_Libraries_LibraryID",
- column: x => x.LibraryID,
- principalTable: "Libraries",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkLibraryProvider_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "PeopleMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PeopleMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_PeopleMetadataID_People_ResourceID",
- column: x => x.ResourceID,
- principalTable: "People",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_PeopleMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Shows",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: false),
- Title = table.Column(type: "TEXT", nullable: true),
- Aliases = table.Column(type: "TEXT", nullable: true),
- Path = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true),
- Status = table.Column(type: "INTEGER", nullable: false),
- StartAir = table.Column(type: "TEXT", nullable: true),
- EndAir = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true),
- IsMovie = table.Column(type: "INTEGER", nullable: false),
- StudioID = table.Column(type: "INTEGER", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Shows", x => x.ID);
- table.ForeignKey(
- name: "FK_Shows_Studios_StudioID",
- column: x => x.StudioID,
- principalTable: "Studios",
- principalColumn: "ID",
- onDelete: ReferentialAction.SetNull);
- });
-
- migrationBuilder.CreateTable(
- name: "StudioMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_StudioMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_StudioMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_StudioMetadataID_Studios_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Studios",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkCollectionShow",
- columns: table => new
- {
- CollectionID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkCollectionShow", x => new { x.CollectionID, x.ShowID });
- table.ForeignKey(
- name: "FK_LinkCollectionShow_Collections_CollectionID",
- column: x => x.CollectionID,
- principalTable: "Collections",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkCollectionShow_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkLibraryShow",
- columns: table => new
- {
- LibraryID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkLibraryShow", x => new { x.LibraryID, x.ShowID });
- table.ForeignKey(
- name: "FK_LinkLibraryShow_Libraries_LibraryID",
- column: x => x.LibraryID,
- principalTable: "Libraries",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkLibraryShow_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkShowGenre",
- columns: table => new
- {
- GenreID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkShowGenre", x => new { x.GenreID, x.ShowID });
- table.ForeignKey(
- name: "FK_LinkShowGenre_Genres_GenreID",
- column: x => x.GenreID,
- principalTable: "Genres",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkShowGenre_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "LinkUserShow",
- columns: table => new
- {
- UsersID = table.Column(type: "INTEGER", nullable: false),
- WatchedID = table.Column(type: "INTEGER", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_LinkUserShow", x => new { x.UsersID, x.WatchedID });
- table.ForeignKey(
- name: "FK_LinkUserShow_Shows_WatchedID",
- column: x => x.WatchedID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_LinkUserShow_Users_UsersID",
- column: x => x.UsersID,
- principalTable: "Users",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "PeopleRoles",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- PeopleID = table.Column(type: "INTEGER", nullable: false),
- ShowID = table.Column(type: "INTEGER", nullable: false),
- Type = table.Column(type: "TEXT", nullable: true),
- Role = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_PeopleRoles", x => x.ID);
- table.ForeignKey(
- name: "FK_PeopleRoles_People_PeopleID",
- column: x => x.PeopleID,
- principalTable: "People",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_PeopleRoles_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Seasons",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: true),
- ShowID = table.Column(type: "INTEGER", nullable: false),
- SeasonNumber = table.Column(type: "INTEGER", nullable: false),
- Title = table.Column(type: "TEXT", nullable: true),
- Overview = table.Column(type: "TEXT", nullable: true),
- StartDate = table.Column(type: "TEXT", nullable: true),
- EndDate = table.Column(type: "TEXT", nullable: true),
- Images = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Seasons", x => x.ID);
- table.ForeignKey(
- name: "FK_Seasons_Shows_ShowID",
- column: x => x.ShowID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "ShowMetadataID",
- columns: table => new
- {
- ResourceID = table.Column(type: "INTEGER", nullable: false),
- ProviderID = table.Column(type: "INTEGER", nullable: false),
- DataID = table.Column(type: "TEXT", nullable: true),
- Link = table.Column(type: "TEXT", nullable: true)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_ShowMetadataID", x => new { x.ResourceID, x.ProviderID });
- table.ForeignKey(
- name: "FK_ShowMetadataID_Providers_ProviderID",
- column: x => x.ProviderID,
- principalTable: "Providers",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_ShowMetadataID_Shows_ResourceID",
- column: x => x.ResourceID,
- principalTable: "Shows",
- principalColumn: "ID",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "Episodes",
- columns: table => new
- {
- ID = table.Column(type: "INTEGER", nullable: false)
- .Annotation("Sqlite:Autoincrement", true),
- Slug = table.Column(type: "TEXT", nullable: true),
- ShowID = table.Column(type: "INTEGER", nullable: false),
- SeasonID = table.Column