mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 18:54:22 -04:00
Making sqlite work
This commit is contained in:
parent
19e64e8d72
commit
d05e7a24b7
@ -8,14 +8,14 @@
|
||||
<LangVersion>default</LangVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputPath>../Kyoo/bin/$(Configuration)/$(TargetFramework)/plugins/postgresql</OutputPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
<!-- <PropertyGroup>-->
|
||||
<!-- <OutputPath>../Kyoo/bin/$(Configuration)/$(TargetFramework)/plugins/postgresql</OutputPath>-->
|
||||
<!-- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>-->
|
||||
<!-- <ProduceReferenceAssembly>false</ProduceReferenceAssembly>-->
|
||||
<!-- <GenerateDependencyFile>false</GenerateDependencyFile>-->
|
||||
<!-- <GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>-->
|
||||
<!-- <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>-->
|
||||
<!-- </PropertyGroup>-->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
|
||||
|
@ -6,17 +6,17 @@
|
||||
<Authors>Zoe Roux</Authors>
|
||||
<RepositoryUrl>https://github.com/AnonymusRaccoon/Kyoo</RepositoryUrl>
|
||||
<LangVersion>default</LangVersion>
|
||||
<RootNamespace>Kyoo.SQLite</RootNamespace>
|
||||
<RootNamespace>Kyoo.SqLite</RootNamespace>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputPath>../Kyoo/bin/$(Configuration)/$(TargetFramework)/plugins/sqlite</OutputPath>
|
||||
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
|
||||
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
|
||||
<GenerateDependencyFile>false</GenerateDependencyFile>
|
||||
<GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>
|
||||
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||
</PropertyGroup>
|
||||
<!-- <PropertyGroup>-->
|
||||
<!-- <OutputPath>../Kyoo/bin/$(Configuration)/$(TargetFramework)/plugins/sqlite</OutputPath>-->
|
||||
<!-- <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>-->
|
||||
<!-- <ProduceReferenceAssembly>false</ProduceReferenceAssembly>-->
|
||||
<!-- <GenerateDependencyFile>false</GenerateDependencyFile>-->
|
||||
<!-- <GenerateRuntimeConfigurationFiles>false</GenerateRuntimeConfigurationFiles>-->
|
||||
<!-- <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>-->
|
||||
<!-- </PropertyGroup>-->
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="5.0.5">
|
||||
|
@ -56,8 +56,8 @@ namespace Kyoo.SqLite
|
||||
_configuration = configuration;
|
||||
_environment = env;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Configure(IServiceCollection services, ICollection<Type> availableTypes)
|
||||
{
|
||||
@ -68,5 +68,12 @@ namespace Kyoo.SqLite
|
||||
x.EnableDetailedErrors().EnableSensitiveDataLogging();
|
||||
});
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public void Initialize(IServiceProvider provider)
|
||||
{
|
||||
DatabaseContext context = provider.GetRequiredService<DatabaseContext>();
|
||||
context.Database.Migrate();
|
||||
}
|
||||
}
|
||||
}
|
@ -14,7 +14,6 @@
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="5.0.5" />
|
||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.9.4" />
|
||||
<PackageReference Include="xunit" Version="2.4.1" />
|
||||
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
|
||||
|
@ -46,6 +46,9 @@
|
||||
<!-- <ExcludeAssets>all</ExcludeAssets>-->
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="../Kyoo.Authentication/Kyoo.Authentication.csproj">
|
||||
<!-- <ExcludeAssets>all</ExcludeAssets>-->
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="../Kyoo.SqLite/Kyoo.SqLite.csproj">
|
||||
<!-- <ExcludeAssets>all</ExcludeAssets>-->
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
|
@ -5,6 +5,7 @@ using Kyoo.Controllers;
|
||||
using Kyoo.Models;
|
||||
using Kyoo.Models.Options;
|
||||
using Kyoo.Postgresql;
|
||||
using Kyoo.SqLite;
|
||||
using Kyoo.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
@ -46,7 +47,8 @@ namespace Kyoo
|
||||
// TODO remove postgres from here and load it like a normal plugin.
|
||||
_plugins.LoadPlugins(new IPlugin[] {
|
||||
new CoreModule(configuration),
|
||||
new PostgresModule(configuration, host),
|
||||
// new PostgresModule(configuration, host),
|
||||
new SqLiteModule(configuration, host),
|
||||
new AuthenticationModule(configuration, loggerFactory, host)
|
||||
});
|
||||
}
|
||||
|
@ -10,6 +10,10 @@
|
||||
},
|
||||
|
||||
"database": {
|
||||
"sqlite": {
|
||||
"data Source": "kyoo.db",
|
||||
"cache": "Shared"
|
||||
},
|
||||
"postgres": {
|
||||
"server": "127.0.0.1",
|
||||
"port": "5432",
|
||||
|
Loading…
x
Reference in New Issue
Block a user