Skip to content

Commit

Permalink
Update FlywayKonfig.java (#218)
Browse files Browse the repository at this point in the history
Støtte for username med hyphens (må quotes ellers fungerer ikke drop statement for postgres)
  • Loading branch information
frode-carlsen authored Jan 31, 2020
1 parent 846bbaf commit 0423d64
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private Properties lesFlywayPlaceholders() {
private void clean(DataSource dataSource, String username) {
try (Connection c = dataSource.getConnection();
Statement stmt = c.createStatement()) {
stmt.execute("drop owned by " + username.replaceAll("[^a-zA-Z0-9_-]", "_")); // NOSONAR ok her, test konfig
stmt.execute("drop owned by \"" + username.replaceAll("[^a-zA-Z0-9_-]", "_") + "\""); // NOSONAR ok her, test konfig
} catch (SQLException e) {
throw new IllegalStateException("Kunne ikke kjøre clean på db", e);
}
Expand Down

0 comments on commit 0423d64

Please sign in to comment.