From d2bbd18fee66960360e99de2b7a33780ebca4c19 Mon Sep 17 00:00:00 2001 From: Viktor Torstensson Date: Tue, 19 May 2026 12:51:41 +0200 Subject: [PATCH] terminal: create sqlite db directory from configured path Create the SQLite database directory from c.Sqlite.DatabaseFileName instead of the generic network directory. This ensures startup uses the final validated SQLite path, including cases where loadAndValidateConfig has already overridden the database file location to point at the correct network-specific directory. --- config.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 7418eca4..65d53d44 100644 --- a/config.go +++ b/config.go @@ -299,7 +299,10 @@ func (c *Config) NewStores(ctx context.Context, case DatabaseBackendSqlite: // Before we initialize the SQLite store, we'll make sure that // the directory where we will store the database file exists. - err := makeDirectories(networkDir) + // Note that the c.Sqlite.DatabaseFileName may already have + // overwritten in loadAndValidateConfig, so that the correct + // network folder has been chosen. + err := makeDirectories(filepath.Dir(c.Sqlite.DatabaseFileName)) if err != nil { return stores, err }