MPS
 
Get MPS

Migrations

Last modified: 17 December 2024

After a language has been published and users have started using it, the language authors have to be careful with further changes to the language definition. In particular, removing concepts or adding and removing properties, children and references to concepts will introduce incompatibilities between the previous and the next language version. This impacts the users of the language if they update to the next language version, since they may discover that their model no longer matches the language definitions and get appropriate errors reported from their models.

MPS tracks versions of languages used in projects and provides automatic migrations to upgrade the usages of a language to the most recent versions. The language designers can create maintenance "migration" code to run automatically against the user code and thus change the user's code so that it complies with the changes made to the language definition. This is called language migration.

The full language migration story has several aspects:

  • Language designers can write scripts for migrating the user code and bundle them with the language

  • MPS automatically tracks language versions used in the client code

  • MPS controls that the user's project is up-to-date with all language changes

  • MPS runs the necessary migrations, when necessary

There are two types of migrations available in MPS:

  • Language migrations - migrations that upgrade the project to comply with the next version of the language definition. Each language migration is attached to a version of the language definition.

  • Project migrations- these are not triggered by language usages, but instead they themselves define the conditions, under which they should be run. These migrations are always applied to the whole project.