diff --git a/.github/upgrades/scenarios/new-dotnet-version_02bc64/scenario.json b/.github/upgrades/scenarios/new-dotnet-version_02bc64/scenario.json index b237103d..984faf6b 100644 --- a/.github/upgrades/scenarios/new-dotnet-version_02bc64/scenario.json +++ b/.github/upgrades/scenarios/new-dotnet-version_02bc64/scenario.json @@ -3,7 +3,7 @@ "operationId": "02bc6448-a69d-4ff4-a0ec-0db07ec3a09a", "description": "Upgrade solution or project to new version of .NET", "startTime": "2026-03-05T22:18:32.3921759Z", - "lastUpdateTime": "2026-03-07T18:26:16.052623Z", + "lastUpdateTime": "2026-03-08T14:46:31.3820237Z", "stage": "Execution", "properties": {}, "folderPath": "" diff --git a/Jellyfin.Server/Migrations/JellyfinMigrationService.cs b/Jellyfin.Server/Migrations/JellyfinMigrationService.cs index 1c65f18b..00d58175 100644 --- a/Jellyfin.Server/Migrations/JellyfinMigrationService.cs +++ b/Jellyfin.Server/Migrations/JellyfinMigrationService.cs @@ -111,12 +111,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 + /* var databaseCreator = dbContext.Database.GetService() as IRelationalDatabaseCreator ?? throw new InvalidOperationException("Jellyfin does only support relational databases."); if (!await databaseCreator.ExistsAsync().ConfigureAwait(false)) { await databaseCreator.CreateAsync().ConfigureAwait(false); } + */ var historyRepository = dbContext.GetService(); @@ -235,13 +238,16 @@ 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 + /* var databaseCreator = dbContext.Database.GetService() as IRelationalDatabaseCreator; if (databaseCreator is not null && !await databaseCreator.ExistsAsync().ConfigureAwait(false)) { logger.LogInformation("Database does not exist, creating..."); await databaseCreator.CreateAsync().ConfigureAwait(false); } + */ var historyRepository = dbContext.GetService(); @@ -256,12 +262,17 @@ internal class JellyfinMigrationService .ToArray(); (string Key, InternalDatabaseMigration Migration)[] pendingDatabaseMigrations = []; + + // DISABLED for .NET 11 preview: EF Core database migrations don't work with preview SDK + // Database schema is initialized from SQL scripts in PostgresDatabaseProvider instead + /* if (stage is JellyfinMigrationStageTypes.CoreInitialisation) { pendingDatabaseMigrations = migrationsAssembly.Migrations.Where(f => appliedMigrations.All(e => e.MigrationId != f.Key)) .Select(e => (Key: e.Key, Migration: new InternalDatabaseMigration(e, dbContext))) .ToArray(); } + */ (string Key, IInternalMigration Migration)[] pendingMigrations = [.. pendingCodeMigrations, .. pendingDatabaseMigrations]; logger.LogInformation("There are {Pending} migrations for stage {Stage}.", pendingMigrations.Length, stage);