fix(database): enable SQLite WAL before schema reconciliation
This commit is contained in:
@@ -267,6 +267,9 @@ public static class StartupInitializationExtensions
|
||||
var provider = (app.Configuration["Database:Provider"] ?? "sqlite").Trim().ToLowerInvariant();
|
||||
var useSqliteBootstrap = provider is not "mysql" and not "mariadb";
|
||||
|
||||
// Reconciliation opens the file before EF creates it; enable WAL explicitly so readers do not block commits.
|
||||
if (useSqliteBootstrap) db.Database.ExecuteSqlRaw("PRAGMA journal_mode = WAL;");
|
||||
|
||||
// The schema reconciler. Runs TWICE: once before Migrate() and once after.
|
||||
//
|
||||
// Before: legacy databases need hand-added columns repaired and the legacy
|
||||
|
||||
Reference in New Issue
Block a user