CRITICAL FIX: Also disable database migrations in JellyfinMigrationService - was running InitialCreate
This commit is contained in:
@@ -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": ""
|
||||
|
||||
@@ -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<IDatabaseCreator>() 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<IHistoryRepository>();
|
||||
|
||||
@@ -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<IDatabaseCreator>() 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<IHistoryRepository>();
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user