Enhancement
Under certain circumstances you may want to boot an application with a "lower" version than currently noted in the data state. In this case, the version identifier in the dataset is to be reset to the version identifier of the booted application. No real backward migration steps are performed in this case.
Application
If you want to make a special one-time migration on a dataset, which is not included in the main branch of the development of an application, then such a version downgrade is necessary for the change back to the main development branch.
When starting the application, the environment variable or alias tl_version_allow_downgrade must be set to true for the downgrade.
Alias definition:
#!xml <entry name="%tl_version_allow_downgrade%" value="${env:tl_version_allow_downgrade:false}" />
Test
- Include a migration statement on a CWS.
- Start application on this CWS
- Version is upgraded to the local CWS version.
- Start application on trunk again.
- Application refuses to boot because a downgrade is necessary.
- Set environment variable as described above.
- Restart application.
- Application boots normally, downgrade is noted in log.
2020-04-01 13:34:38,279 INFO [main]: top_logic.basic.config.ApplicationConfig - No valid version found for database version 'tl-element:24494-Upgrade_temporary_multiline_annotation_change' in versions [tl-element:22747-Add_GenericObject_table]. 2020-04-01 13:34:38,279 INFO [main]: top_logic.basic.config.ApplicationConfig - Downgrading application version.
- Downgrade application and restart without the environment variable.
- Application still starts normally without migration or downgrade.