Skip to content

Config directory is a bad place for sqlite databases #28

@werrolf

Description

@werrolf

Currently digitizer-styles.sqlite et al live in the app/config tree.

This is not usually a server-writable location. In Docker deployments, we can mount the whole tree as read only except for spefic writable directories, and would benefit from consolidating on a more logical placement of the sqlites, because it is hard / impossible to exempt single files (opposed to dirs) from the read-only policy.

Every project forked from mapbender-starter already has an app/db directory that seems perfect for this. It is logically a place purely for runtime modifiable files, with contents on gitignore.

The code change is quite trivial. The real issue is finding the right strategy to "migrate" the existing sqlite databases on an existing installation from old location to new location, so all data can be maintained.

Otherwise, here's a single sed statement (also munges mapbender/search, which has the same peculiarity of storing sqlite databases in the config dir).
$ sed -i.bak -e 's#"/config/"#"/db/"#g' vendor/mapbender/digitizer/Mapbender/DigitizerBundle/Component/DigitizerStyleManager.php vendor/mapbender/search/Component/BaseManager.php

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions