Skip to content

Commit

Permalink
Fixed flyway#1859: Validation error with schema_version table name
Browse files Browse the repository at this point in the history
  • Loading branch information
Axel Fontaine committed Dec 8, 2017
1 parent 2674fd6 commit 337816f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -113,7 +113,7 @@ public Void call() {
AppliedMigration baselineMarker = schemaHistory.getBaselineMarker();
if (baselineVersion.equals(baselineMarker.getVersion())
&& baselineDescription.equals(baselineMarker.getDescription())) {
LOG.info("Metadata table " + schemaHistory + " already initialized with ("
LOG.info("Schema history table " + schemaHistory + " already initialized with ("
+ baselineVersion + "," + baselineDescription + "). Skipping.");
return null;
}
Expand Down
Expand Up @@ -97,7 +97,8 @@ public void clearCache() {

@Override
public boolean exists() {
if (!tableFallback) {
// Ensure we are using the default table name before checking for the fallback table
if (!tableFallback && table.getName().equals("flyway_schema_history")) {
Table fallbackTable = table.getSchema().getTable("schema_version");
if (fallbackTable.exists()) {
LOG.warn("Could not find schema history table " + table + ", but found " + fallbackTable + " instead." +
Expand Down Expand Up @@ -159,7 +160,7 @@ protected void doAddAppliedMigration(MigrationVersion version, String descriptio
installedRank, versionStr, description, type.name(), script, checksum, installedBy,
executionTime, success);

LOG.debug("MetaData table " + table + " successfully updated to reflect changes");
LOG.debug("Schema history table " + table + " successfully updated to reflect changes");
} catch (SQLException e) {
throw new FlywaySqlException("Unable to insert row for version '" + version + "' in Schema History table " + table, e);
}
Expand Down

0 comments on commit 337816f

Please sign in to comment.