Package sonia.scm.migration


package sonia.scm.migration
This package holds classes for data migrations between different versions of SCM-Manager or its plugins. The central classes for this are UpdateStep and RepositoryUpdateStep. Implementations of these classes tell, what data they migrate (UpdateStepTarget.getAffectedDataType()) and to what version this data type is migrated (UpdateStepTarget.getTargetVersion()).

The data type provided by UpdateStepTarget.getAffectedDataType() can be an arbitrary string, but it is considered a best practice to use a qualified name, for example

  • com.example.myPlugin.configuration
  • for data in plugins, or
  • com.cloudogu.scm.repository
  • for core data structures.

The version provided by UpdateStepTarget.getTargetVersion() is unrelated to other versions and therefore can be chosen freely, so that a data type can be updated without in various ways independent of other data types or the official version of the plugin or the core. A coordination between different data types and their versions is only necessary, when update steps of different data types rely on each other. If a update step of data type A has to run before another step for data type B, the version number of the second step has to be greater in regards to Version.compareTo(Version).

The algorithm looks something like this:
Whenever the SCM-Manager starts,

Mind that an implementation of this class has to be annotated with Extension, so that the step will be found.