mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Applied review suggestions
This commit is contained in:
parent
efb402b1d2
commit
c9237ae731
@ -9,7 +9,7 @@ using Npgsql;
|
||||
namespace Jellyfin.Database.Providers.PgSql;
|
||||
|
||||
/// <summary>
|
||||
/// Configures jellyfin to use an SqLite database.
|
||||
/// Configures jellyfin to use an Postgres database.
|
||||
/// </summary>
|
||||
[JellyfinDatabaseProviderKey("Jellyfin-PgSql")]
|
||||
public sealed class PgSqlDatabaseProvider : IJellyfinDatabaseProvider
|
||||
|
@ -8,9 +8,9 @@ using Microsoft.Extensions.Logging;
|
||||
namespace Jellyfin.Database.Providers.SqLite;
|
||||
|
||||
/// <summary>
|
||||
/// Configures jellyfin to use an SqLite database.
|
||||
/// Configures jellyfin to use an SQLite database.
|
||||
/// </summary>
|
||||
[JellyfinDatabaseProviderKey("Jellyfin-SqLite")]
|
||||
[JellyfinDatabaseProviderKey("Jellyfin-SQLite")]
|
||||
public sealed class SqliteDatabaseProvider : IJellyfinDatabaseProvider
|
||||
{
|
||||
private readonly IApplicationPaths _applicationPaths;
|
||||
|
@ -12,12 +12,12 @@ When creating a new migration, you always have to create migrations for all prov
|
||||
dotnet ef migrations add MIGRATION_NAME --project "PATH_TO_PROJECT" -- --provider PROVIDER_KEY
|
||||
```
|
||||
|
||||
with both sqlite and pgsql currently beeing supported and both need migrations, you need to run the efcore tool with the correct project to tell EfCore where to store the migrations and the correct provider key to tell jellyfin to load that provider.
|
||||
with both sqlite and pgsql currently beeing supported and both need migrations, you need to run the Entity Framework tool with the correct project to tell EFCore where to store the migrations and the correct provider key to tell jellyfin to load that provider.
|
||||
|
||||
The example is made from the root folder of the project e.g for codespaces `/workspaces/jellyfin`
|
||||
|
||||
```cmd
|
||||
dotnet ef migrations add {MIGRATION_NAME} --project "Jellyfin.Database/Jellyfin.Database.Providers.SqLite" -- --migration-provider Jellyfin-SqLite
|
||||
dotnet ef migrations add {MIGRATION_NAME} --project "Jellyfin.Database/Jellyfin.Database.Providers.SqLite" -- --migration-provider Jellyfin-SQLite
|
||||
dotnet ef migrations add {MIGRATION_NAME} --project "Jellyfin.Database/Jellyfin.Database.Providers.PgSql" -- --migration-provider Jellyfin-PgSql
|
||||
```
|
||||
|
||||
|
@ -72,10 +72,10 @@ public static class ServiceCollectionExtensions
|
||||
}
|
||||
else
|
||||
{
|
||||
// when nothing is setup via new Database configuration, fallback to SqLite with default settings.
|
||||
// when nothing is setup via new Database configuration, fallback to SQLite with default settings.
|
||||
efCoreConfiguration = new DatabaseConfigurationOptions()
|
||||
{
|
||||
DatabaseType = "Jellyfin-SqLite",
|
||||
DatabaseType = "Jellyfin-SQLite",
|
||||
};
|
||||
configurationManager.SaveConfiguration("database", efCoreConfiguration);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ public class EfMigrationTests
|
||||
{
|
||||
var dbDesignContext = new PgSqlDesignTimeJellyfinDbFactory();
|
||||
var context = dbDesignContext.CreateDbContext([]);
|
||||
Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model for PgSQL. Please create a Migration.");
|
||||
Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EFCore model for PgSQL. Please create a Migration.");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@ -22,6 +22,6 @@ public class EfMigrationTests
|
||||
{
|
||||
var dbDesignContext = new SqliteDesignTimeJellyfinDbFactory();
|
||||
var context = dbDesignContext.CreateDbContext([]);
|
||||
Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EfCore model for PgSQL. Please create a Migration.");
|
||||
Assert.False(context.Database.HasPendingModelChanges(), "There are unapplied changes to the EFCore model for SQLite. Please create a Migration.");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user