Background
This is related to discussion which came from #137
Occasionally we have to modify the structure of the shipthis.json file to adapt for new features or adjustments to resolve issues.
When doing this, it would be nice if we had a system in place to upgrade the config data structure and resave the file.
Proposal
- Adjust the shipthis.json schema to include a version number (possibly just an integer)
- Formalize the schema versions including validation of the config
- Create a set of versioned migrations with "up" and "down" methods
- The migrations will need be applied in order so we should create a
migrate method which loops through them
- Decide on when the tool should do this (at boot - before any commands, first time we read from the config file, before any game related commands)
TODO
References / Reading
Background
This is related to discussion which came from #137
Occasionally we have to modify the structure of the shipthis.json file to adapt for new features or adjustments to resolve issues.
When doing this, it would be nice if we had a system in place to upgrade the config data structure and resave the file.
Proposal
migratemethod which loops through themTODO
References / Reading
Nick Scialli - https://levelup.gitconnected.com/an-approach-to-javascript-object-schema-migration-ae1bd9f0ce78