Skip to content

Commit ad0cfb7

Browse files
authored
Merge pull request #134 from ebean-orm/feature/bump-version
Modify JdbcMigration interface to extend MigrationChecksumProvider
2 parents bc56da1 + 56268aa commit ad0cfb7

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

ebean-migration/src/main/java/io/ebean/migration/JdbcMigration.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,15 @@
1414
*
1515
* @author Roland Praml, FOCONIS AG
1616
*/
17-
public interface JdbcMigration {
17+
public interface JdbcMigration extends MigrationChecksumProvider {
1818

1919
/**
2020
* Execute the migration using the connection.
2121
*/
2222
void migrate(Connection connection);
23+
24+
@Override
25+
default int getChecksum() {
26+
return 0;
27+
}
2328
}

ebean-migration/src/main/java/io/ebean/migration/runner/LocalJdbcMigrationResource.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package io.ebean.migration.runner;
22

33
import io.ebean.migration.JdbcMigration;
4-
import io.ebean.migration.MigrationChecksumProvider;
54
import io.ebean.migration.MigrationVersion;
65

76
/**
@@ -32,11 +31,7 @@ JdbcMigration migration() {
3231
* Returns the checksum of the migration routine.
3332
*/
3433
int checksum() {
35-
if (migration instanceof MigrationChecksumProvider) {
36-
return ((MigrationChecksumProvider) migration).getChecksum();
37-
} else {
38-
return 0; // maybe we can build a checksum over the byte code, but this may change on different java versions.
39-
}
34+
return migration.getChecksum();
4035
}
4136

4237
@Override

0 commit comments

Comments
 (0)