Add automatic PostgreSQL database creation and migration

- Added Jellyfin.Database.Providers.Postgres project with full EF Core migration support for PostgreSQL.
- Implemented automatic database creation and privilege assignment on startup.
- Generated initial migration and model snapshot for PostgreSQL schema.
- Updated build, test, and dependency files to include PostgreSQL provider and Npgsql packages.
- Added PowerShell script for generating and testing PostgreSQL migrations.
- No changes to application logic outside database provider/migration infrastructure.
This commit is contained in:
2026-02-22 18:51:24 -05:00
parent 0efab2cfb6
commit a3eb4b1b57
52 changed files with 9233 additions and 33 deletions
@@ -12,6 +12,7 @@ using System.Reflection;
using Jellyfin.Database.Implementations;
using Jellyfin.Database.Implementations.DbConfiguration;
using Jellyfin.Database.Implementations.Locking;
using Jellyfin.Database.Providers.Postgres;
using Jellyfin.Database.Providers.Sqlite;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Configuration;
@@ -28,6 +29,9 @@ public static class ServiceCollectionExtensions
private static IEnumerable<Type> DatabaseProviderTypes()
{
yield return typeof(SqliteDatabaseProvider);
yield return typeof(PostgresDatabaseProvider);
// Add additional built-in providers here:
// yield return typeof(MySqlDatabaseProvider);
}
private static IDictionary<string, JellyfinDbProviderFactory> GetSupportedDbProviders()