In time, the publicodes models evolve. When a model is updated (e.g. a rule
is renamed, a value is changed, a new rule is added, etc.), we want to ensure
that the previous situations (i.e. answers to questions) are still valid.
constinstructions = { keysToMigrate: { // The rule `age` has been renamed to `âge`. age:'âge', // The rule `city` has been removed. city:'' }, valuesToMigrate: { job: { // The value `developer` has been translated to `développeur`. developer:'développeur' } } }
Situation migration
Why?
In time, the
publicodesmodels evolve. When a model is updated (e.g. a rule is renamed, a value is changed, a new rule is added, etc.), we want to ensure that the previous situations (i.e. answers to questions) are still valid.This is where the sitation migration comes in.
Usage
migrateSituationallows to migrate a situation from an old version of a model to a new version according to the provided migration instructions.