CRITICAL: Also disable EnsureCreatedAsync - it was bypassing migration tracking and creating schema
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-07T17:48:10.3399967Z",
|
||||
"lastUpdateTime": "2026-03-07T17:59:55.6322536Z",
|
||||
"stage": "Execution",
|
||||
"properties": {},
|
||||
"folderPath": ""
|
||||
|
||||
+5
-2
@@ -380,8 +380,11 @@ public sealed class PostgresDatabaseProvider : IJellyfinDatabaseProvider
|
||||
var context = await DbContextFactory!.CreateDbContextAsync(cancellationToken).ConfigureAwait(false);
|
||||
await using (context.ConfigureAwait(false))
|
||||
{
|
||||
// Ensure the migrations history table exists
|
||||
await context.Database.EnsureCreatedAsync(cancellationToken).ConfigureAwait(false);
|
||||
// DISABLED for .NET 11 preview: EnsureCreatedAsync bypasses migrations and creates schema directly
|
||||
// This prevents proper migration tracking. Use manual SQL scripts instead.
|
||||
// await context.Database.EnsureCreatedAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
logger.LogInformation("Database schema creation disabled for .NET 11 preview. Database must be initialized using SQL scripts in sql/schema_init/ directory.");
|
||||
|
||||
// Get applied migrations
|
||||
var appliedMigrations = await context.Database.GetAppliedMigrationsAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
Reference in New Issue
Block a user