File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/providers/WorkflowCore.Persistence.EntityFramework/Services Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -57,10 +57,15 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
57
57
base . OnConfiguring ( optionsBuilder ) ;
58
58
optionsBuilder . UseQueryTrackingBehavior ( QueryTrackingBehavior . NoTracking ) ;
59
59
60
- // Suppress pending model changes warning when using newer EF Core versions with older ModelSnapshots
61
- // This prevents false positive warnings when the ProductVersion in ModelSnapshot differs from runtime
60
+ // Configure warning handling for PendingModelChangesWarning
61
+ // This warning can be triggered by:
62
+ // 1. ProductVersion mismatch (false positive when using EF Core 9.x with older snapshots)
63
+ // 2. Legitimate model changes that need migrations
64
+ //
65
+ // We convert the warning to a log message so developers can still see it in logs
66
+ // but it won't throw an exception that prevents application startup
62
67
optionsBuilder . ConfigureWarnings ( warnings =>
63
- warnings . Ignore ( Microsoft . EntityFrameworkCore . Diagnostics . RelationalEventId . PendingModelChangesWarning ) ) ;
68
+ warnings . Log ( Microsoft . EntityFrameworkCore . Diagnostics . RelationalEventId . PendingModelChangesWarning ) ) ;
64
69
}
65
70
}
66
71
}
You can’t perform that action at this time.
0 commit comments