fix(database): enable SQLite WAL before schema reconciliation

This commit is contained in:
cesnimda
2026-10-21 08:04:26 +02:00
parent a15336cc94
commit f51e0506cc
10 changed files with 594 additions and 3 deletions
@@ -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