config-migrate
Tool (built as node module) to track, manage and apply structural/data changes to your json config files
+---+ +---+ +---------------------+ +---------------+ +----------------------+ | | | | | | | Bahmni Config Files | +-----> config-migrate| +---> | Updated Config Files | | | | | | | +---------------------+ +-------^-------+ +----------------------+ | | + |---| |-----------------+ | | | Migration Files | | | +-----------------+
Where,
- Config Files - Your config files which needs to be updated
- Migration Files - All the migration javascript files to be run
Migration Files
The migration files follow a naming convention
V1__convert_arrays_to_maps.js
Where,
- V - Prefix
- __ - separator
- convert_arrays_to_maps - name of the migration
The migration can use lodash methods in it
Config Files
When the migrations are run, a file named 'migration-run-log.txt' will be generated to remember the already run migrations. Keep this file versioned along with other config files
Usage
- npm install -g config-migrate
- Run the following command
config-migrate config_folder_full_path migration_files_folder_full_path