Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Mybatis-Migration support to 3.3.7 to work around an error in… #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<spring-boot.version>2.1.0.RELEASE</spring-boot.version>
<mybatis-migrations.version>3.3.1</mybatis-migrations.version>
<mybatis-migrations.version>3.3.7</mybatis-migrations.version>
<jcommander.version>1.69</jcommander.version>
</properties>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package de.bessonov.mybatis.migrations;

import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
import java.util.TreeSet;
import java.util.stream.Collectors;

import org.apache.ibatis.migration.Change;
import org.apache.ibatis.migration.MigrationException;
import org.apache.ibatis.migration.MigrationLoader;
Expand Down Expand Up @@ -111,9 +109,11 @@ protected Change parseChangeFromFilename(String filename) {

protected Reader getReader(String fileName, boolean undo) {
try {
try (InputStream file = getResource(fileName).getURL().openStream()) {
return new MigrationReader(file, charset, undo, properties);
Resource scriptResource = getResource(fileName);
if (scriptResource.exists()) {
return new MigrationReader(scriptResource.getInputStream(), charset, undo, properties);
}
return null;
} catch (IOException e) {
throw new MigrationException("Error reading " + fileName, e);
}
Expand Down