Introduce global persistent database properties #582
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this change import settings can be saved in the database and retrieved at update time and when running the server. The settings are saved in a document with a special ID in an non-indexed field. They can only be retrieved via the ID or matchAll(). Currently two properties are saved: database version and language settings.
With the database version it is now possible to check that the right version of Photon is used against the database. If we have incompatible changes to the mapping schema in the future then Photon will refuse to run when software version and database version do not match.
The language settings are saved so that it is no longer necessary to supply the '-language' parameter each time Photon is started in server mode. The server will simply use the settings from the import. '-language' can still be used to reduce the set of available languages. It is no longer possible to add a language that was not imported. When running updates from the command line then the '-language' parameter is ignored completely and the database setting used.
This PR also removes the `-recreate-index' command line option. It is not very useful anymore as the import will always start with wiping the database now. If somebody was still using this command, please shout.