Re-enable database creation check to prevent crash when database doesn't exist

This commit is contained in:
2026-03-08 11:31:08 -04:00
parent caa30d8b88
commit e790f84ace
2 changed files with 5 additions and 6 deletions
@@ -238,16 +238,15 @@ internal class JellyfinMigrationService
var dbContext = await _dbContextFactory.CreateDbContextAsync().ConfigureAwait(false);
await using (dbContext.ConfigureAwait(false))
{
// DISABLED for .NET 11 preview: Database creation handled by PostgresDatabaseProvider using SQL scripts
// Ensure the migration history table exists before querying it
/*
// Ensure database exists before querying migration history
// Note: This does NOT run migrations, it only ensures the database itself exists
var databaseCreator = dbContext.Database.GetService<IDatabaseCreator>() as IRelationalDatabaseCreator;
if (databaseCreator is not null && !await databaseCreator.ExistsAsync().ConfigureAwait(false))
{
logger.LogInformation("Database does not exist, creating...");
logger.LogInformation("Database does not exist, creating empty database...");
await databaseCreator.CreateAsync().ConfigureAwait(false);
logger.LogInformation("Empty database created successfully");
}
*/
var historyRepository = dbContext.GetService<IHistoryRepository>();