We are upgrading the application’s mysql version from 5.7 to 8. As part of the process, we also need to upgrade the hsqldb to the compatible version. Below is the summary for the same
Item. | Existing | Latest |
---|---|---|
Java | Java 8 | Java 8 |
HSQLDB | 2.3.3 | 2.7.2 |
Liquibase | 3.4.2 | 3.6.3 |
Mysql-java- | 8.0.22. | 8.0.33 |
connector |
When the liquibase migrations are executed in test cases which uses hswldb, specific migrations having an element as “customChange“, which have a pre-condition for dbms type as mysql, are getting executed for hsqldb. Sample migration:
<changeSet id="34" author="AJ">
<preConditions onFail="MARK_RAN">
<dbms type="mysql"/>
</preConditions>
<comment>My comment</comment>
<customChange class="com.company.migrator.custom.CustomMigration"/>
</changeSet>
On a side note, hsqldb does not provide a 2.7x version jar for java 8, instead need to use an alternative jar as below:
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.7.2</version>
<classifier>jdk8</classifier>
</dependency>
Initially was getting the error for liquibase 3.4.2. Gave a try be upgrading to 3.6.3 but no luck. I tried to include a maven plugin as below and directly trying to execute liquibase(mvn liquibase:update) command and give the expected output.
<plugin>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-maven-plugin</artifactId>
<version>3.4.2</version>
<configuration>
<changeLogFile>problematic changelog file path</changeLogFile>
<promptOnNonLocalDatabase>false</promptOnNonLocalDatabase>
<logging>debug</logging>
<url> url</url>
<username></username>
<password></password>
</configuration>
</plugin>
Marking ChangeSet: xxx::xxx::xxx ran despite precondition failure due to onFail=’MARK_RAN’:
tenant/changelog.xml : DBMS Precondition failed: expected mysql, got hsqldb
But the issue surfaces when running mvn clean install or mvn clean test.
I have been scatching my head for a couple of days now. A solution would give me a big relief. Thanks in advance for the help!