Skip to content

Commit

Permalink
Fixed the root cause of Java migration checksum validation error
Browse files Browse the repository at this point in the history
  • Loading branch information
Noriaki Tatsumi committed Dec 31, 2015
1 parent 7cd42e8 commit 1ec13c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public List<AppliedMigration> findAppliedMigrations() {
row.getString("description"),
MigrationType.valueOf(row.getString("type")),
row.getString("script"),
row.getInt("checksum"),
row.isNull("checksum") ? null : row.getInt("checksum"),
row.getDate("installed_on"),
row.getString("installed_by"),
row.getInt("execution_time"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ ResolvedMigration extractMigrationInfo(JavaMigration javaMigration) {
if (javaMigration instanceof MigrationChecksumProvider) {
MigrationChecksumProvider checksumProvider = (MigrationChecksumProvider) javaMigration;
checksum = checksumProvider.getChecksum();
} else {
checksum = 0;
}

MigrationVersion version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void resolveMigrations() {
ResolvedMigration migrationInfo = migrationList.get(0);
assertEquals("2", migrationInfo.getVersion().toString());
assertEquals("InterfaceBasedMigration", migrationInfo.getDescription());
assertEquals(0, migrationInfo.getChecksum().intValue());
assertNull(migrationInfo.getChecksum());

ResolvedMigration migrationInfo1 = migrationList.get(1);
assertEquals("3.5", migrationInfo1.getVersion().toString());
Expand All @@ -68,7 +68,7 @@ public void conventionOverConfiguration() {
ResolvedMigration migrationInfo = jdbcMigrationResolver.extractMigrationInfo(new V2__InterfaceBasedMigration());
assertEquals("2", migrationInfo.getVersion().toString());
assertEquals("InterfaceBasedMigration", migrationInfo.getDescription());
assertEquals(0, migrationInfo.getChecksum().intValue());
assertNull(migrationInfo.getChecksum());
}

@Test
Expand Down

0 comments on commit 1ec13c3

Please sign in to comment.