-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fix Datasource timing issues with Liquibase / Flyway and OpenTelemetry
- Loading branch information
Showing
7 changed files
with
121 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 10 additions & 4 deletions
14
...ions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayContainersSupplier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 9 additions & 7 deletions
16
extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywaySchemaProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,25 @@ | ||
package io.quarkus.flyway.runtime; | ||
|
||
import io.quarkus.arc.Arc; | ||
import io.quarkus.datasource.runtime.DatabaseSchemaProvider; | ||
|
||
public class FlywaySchemaProvider implements DatabaseSchemaProvider { | ||
|
||
@Override | ||
public void resetDatabase(String dbName) { | ||
for (FlywayContainer i : FlywayRecorder.FLYWAY_CONTAINERS) { | ||
if (i.getDataSourceName().equals(dbName)) { | ||
i.getFlyway().clean(); | ||
i.getFlyway().migrate(); | ||
for (FlywayContainer flywayContainer : Arc.container().select(FlywayContainer.class)) { | ||
if (flywayContainer.getDataSourceName().equals(dbName)) { | ||
flywayContainer.getFlyway().clean(); | ||
flywayContainer.getFlyway().migrate(); | ||
} | ||
} | ||
} | ||
|
||
@Override | ||
public void resetAllDatabases() { | ||
for (FlywayContainer i : FlywayRecorder.FLYWAY_CONTAINERS) { | ||
i.getFlyway().clean(); | ||
i.getFlyway().migrate(); | ||
for (FlywayContainer flywayContainer : Arc.container().select(FlywayContainer.class)) { | ||
flywayContainer.getFlyway().clean(); | ||
flywayContainer.getFlyway().migrate(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters