Skip to content

Commit

Permalink
Use same SQL as in the ChangeLog.xml and remove the no longer needed …
Browse files Browse the repository at this point in the history
…ChangeLog.xml

The ChangeLog.xml is not needed because we are using the JDBC Connection directly to do the query
  • Loading branch information
filiphr committed Aug 26, 2024
1 parent e595ea5 commit 31c16fc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
<mapper resource="org/flowable/common/db/mapping/entity/Property.xml" />
<mapper resource="org/flowable/common/db/mapping/entity/ByteArray.xml" />
<mapper resource="org/flowable/common/db/mapping/entity/TableData.xml" />
<mapper resource="org/flowable/common/db/mapping/ChangeLog.xml" />
<mapper resource="org/flowable/common/db/mapping/common.xml" />

<mapper resource="org/flowable/cmmn/db/mapping/ChangeTenantCmmn.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<mappers>
<!-- Common mappers -->
<mapper resource="org/flowable/common/db/mapping/entity/Property.xml" />
<mapper resource="org/flowable/common/db/mapping/ChangeLog.xml" />
<mapper resource="org/flowable/common/db/mapping/common.xml" />

<mapper resource="org/flowable/dmn/db/mapping/ChangeTenantDmn.xml" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,16 @@ protected ChangeLogVersion getChangeLogVersion() {
changeLogTableName = prependDatabaseTablePrefix(changeLogTableName);
}
try (PreparedStatement statement = databaseConfiguration.getConnection()
.prepareStatement("select ID from " + changeLogTableName + " order by DATEEXECUTED desc")) {
.prepareStatement("select ID from " + changeLogTableName + " order by DATEEXECUTED")) {
String changeLogVersion = null;
try (ResultSet resultSet = statement.executeQuery()) {
if (resultSet.next()) {
String changeLogVersion = resultSet.getString(1);
return new ChangeLogVersion(changeLogVersion, getDbVersionForChangelogVersion(changeLogVersion));
while (resultSet.next()) {
changeLogVersion = resultSet.getString(1);
}
}
if (changeLogVersion != null) {
return new ChangeLogVersion(changeLogVersion, getDbVersionForChangelogVersion(changeLogVersion));
}
} catch (SQLException e) {
throw new RuntimeException("Failed to get change log version from " + changeLogTableName, e);
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
<!-- Common mappers -->
<mapper resource="org/flowable/common/db/mapping/entity/Property.xml" />
<mapper resource="org/flowable/common/db/mapping/entity/TableData.xml" />
<mapper resource="org/flowable/common/db/mapping/ChangeLog.xml" />
<mapper resource="org/flowable/common/db/mapping/common.xml" />

<!-- Engine mappers -->
Expand Down

0 comments on commit 31c16fc

Please sign in to comment.