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.
This commit is contained in:
Viktor Torstensson 2026-05-19 12:51:41 +02:00
parent c5ec8703d4
commit d2bbd18fee
No known key found for this signature in database
GPG key ID: 961CC8259AE675D4

View file

@ -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
}