How does it workLet’s see how it works with an example. We start out with the table customer in version 3.80. This table is renamed to clients in version 3.90, for which we create a data conversion record.
In version 4.00 we rename the table clients to client (because we always use singular nouns for entity names), so another data conversion record is created.
If you want to upgrade from version 3.80 to version 4.00 without doing an intermediate upgrade to version 3.90, you need to squash the data conversion. In the newly created data conversion definition for version 3.80 to 4.00, the table customer is directly renamed to client.
Squash taskWith version 2018.1 of the Software Factory, it is possible to automatically create a squashed data conversion definition based on the data conversions of the versions in between. This can be done by using the task “Squash data conversions”.
This task will create the squashed data conversion and update the previous version. There can be as many intermediate versions as you like, they can even refer to versions in other projects (or branches).
Squashing branchesWe advice to always create branches for new features. The squash-task can be used to squash data conversion in these situations as well. The new data conversion definition must include both the trunk and the branch changes. This can be done by executing the squash-task twice. In the figure below, this is demonstrated with an example.
First, merge the branch and the trunk versions to create version 4.10. Update the previous version of version 4.10 to version 4.00 and use the squash-task to consolidate the data conversion definition for version 3.80 to version 4.10.
Then update the previous version of version 4.10 to branch version 1.20. Make sure that the previous version of the first version of the branch (usually 1.00) is set to version 3.80 of the trunk. This will create a conversion path between versions 3.80 and 4.10 via the branch. When you execute the squash-task for the second time, the task will respect the existing data conversion definition and add the data conversion definitions from the branch versions.
Hope you enjoyed this post and go squash those versions!