From 6e9ccf7211aec68df5f15e4a4cceb6315b5d4c63 Mon Sep 17 00:00:00 2001 From: Tommy van der Vorst Date: Tue, 2 Sep 2025 21:03:22 +0200 Subject: [PATCH] fix(db): only vacuum database on startup when a migration script was actually run (#10339) --- internal/db/sqlite/basedb.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/db/sqlite/basedb.go b/internal/db/sqlite/basedb.go index ddb9363d4..5bc6d4574 100644 --- a/internal/db/sqlite/basedb.go +++ b/internal/db/sqlite/basedb.go @@ -110,6 +110,7 @@ func openBase(path string, maxConns int, pragmas, schemaScripts, migrationScript } if int(n) > ver.SchemaVersion { slog.Info("Applying database migration", slogutil.FilePath(db.baseName), slog.String("script", scr)) + shouldVacuum = true return true } return false @@ -118,7 +119,6 @@ func openBase(path string, maxConns int, pragmas, schemaScripts, migrationScript if err := db.runScripts(tx, script, filter); err != nil { return nil, wrap(err) } - shouldVacuum = true } }