Update Postgres connection string in design-time factory for testing environment
This commit is contained in:
@@ -366,7 +366,7 @@ public class JellyfinDbContext(DbContextOptions<JellyfinDbContext> options, ILog
|
||||
{
|
||||
// Process each conflicted entry
|
||||
var entriesToRemove = new List<Microsoft.EntityFrameworkCore.ChangeTracking.EntityEntry>();
|
||||
|
||||
|
||||
foreach (var entry in ex.Entries)
|
||||
{
|
||||
try
|
||||
@@ -374,7 +374,7 @@ public class JellyfinDbContext(DbContextOptions<JellyfinDbContext> options, ILog
|
||||
// Attempt to reload the entity from the database to get the latest version
|
||||
// This will fail silently for deleted entities
|
||||
await entry.ReloadAsync(cancellationToken).ConfigureAwait(false);
|
||||
|
||||
|
||||
// Check if the entity still exists in the database
|
||||
// If it was deleted, it will have a null entity state after reload
|
||||
if (entry.State == EntityState.Detached)
|
||||
@@ -386,7 +386,7 @@ public class JellyfinDbContext(DbContextOptions<JellyfinDbContext> options, ILog
|
||||
{
|
||||
// Re-mark as Modified since reload resets the state
|
||||
entry.State = EntityState.Modified;
|
||||
|
||||
|
||||
// Re-apply concurrency token update for entities that still exist
|
||||
if (entry.Entity is IHasConcurrencyToken concurrencyEntity)
|
||||
{
|
||||
@@ -420,6 +420,7 @@ public class JellyfinDbContext(DbContextOptions<JellyfinDbContext> options, ILog
|
||||
{
|
||||
logger.LogInformation("Concurrency retry {RetryCount} succeeded, saved {RowsAffected} row(s).", i + 1, result);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (DbUpdateConcurrencyException retryEx) when (i < maxRetries - 1)
|
||||
|
||||
+2793
File diff suppressed because it is too large
Load Diff
+6541
File diff suppressed because it is too large
Load Diff
+1533
-549
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -21,7 +21,7 @@ internal sealed class PostgresDesignTimeJellyfinDbFactory : IDesignTimeDbContext
|
||||
{
|
||||
var optionsBuilder = new DbContextOptionsBuilder<JellyfinDbContext>();
|
||||
optionsBuilder.UseNpgsql(
|
||||
"Host=localhost;Database=jellyfin;Username=jellyfin;Password=jellyfin",
|
||||
"Host=192.168.129.253;Port=6432;Database=jellyfin_test2;Username=jellyfin;Password=jellyfin",
|
||||
npgsqlOptions => npgsqlOptions.MigrationsAssembly(GetType().Assembly.FullName));
|
||||
|
||||
return new JellyfinDbContext(
|
||||
|
||||
Reference in New Issue
Block a user