Skip to content

Commit

Permalink
fjerner flyway clean on validation error for tester ettersom det ikke… (
Browse files Browse the repository at this point in the history
#2804)

fjerner flyway clean on validation error for tester ettersom det ikke er støttet mot oracle
  • Loading branch information
palfi committed Apr 18, 2024
1 parent 51ea1ec commit 61b1bab
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static java.lang.Runtime.getRuntime;

import java.sql.SQLException;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicBoolean;

Expand Down Expand Up @@ -54,14 +55,12 @@ public static void migrerUnittestSkjemaer() {
throw new IllegalStateException("Forventer at denne migreringen bare kjøres lokalt");
}
flyway.migrate();
} catch (FlywayException fwe) {
try {
// prøver igjen
flyway.clean();
flyway.migrate();
} catch (FlywayException fwe2) {
throw new IllegalStateException("Migrering feiler", fwe2);
var connection = flyway.getConfiguration().getDataSource().getConnection();
if (!connection.isClosed()) {
connection.close();
}
} catch (SQLException sqlex) {
// nothing to do here
}
}
}
Expand Down

0 comments on commit 61b1bab

Please sign in to comment.