From 3e3dacc2f121d75ffa3891638f9238fcf635ad0d Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 20 Dec 2021 19:06:00 +0200 Subject: [PATCH] Bring back erroneously removed Flyway Dev Console route handler This was erroneously removed in fa62e3f67dfab1957c93fadb7fb6e0e4e551847d Fixes: #22407 (cherry picked from commit 9cd2148d2816ec1f65723e185aface3e3c197af7) --- .../io/quarkus/flyway/FlywayDevConsoleProcessor.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/FlywayDevConsoleProcessor.java b/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/FlywayDevConsoleProcessor.java index bdafb3e2224b6..35154bf7f7820 100644 --- a/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/FlywayDevConsoleProcessor.java +++ b/extensions/flyway/deployment/src/main/java/io/quarkus/flyway/FlywayDevConsoleProcessor.java @@ -1,5 +1,6 @@ package io.quarkus.flyway; +import static io.quarkus.deployment.annotations.ExecutionTime.RUNTIME_INIT; import static java.util.List.of; import java.nio.file.Files; @@ -15,6 +16,7 @@ import io.quarkus.agroal.spi.JdbcInitialSQLGeneratorBuildItem; import io.quarkus.deployment.IsDevelopment; import io.quarkus.deployment.annotations.BuildStep; +import io.quarkus.deployment.annotations.Record; import io.quarkus.deployment.pkg.builditem.CurateOutcomeBuildItem; import io.quarkus.dev.config.CurrentConfig; import io.quarkus.dev.console.DevConsoleManager; @@ -24,6 +26,7 @@ import io.quarkus.flyway.runtime.FlywayBuildTimeConfig; import io.quarkus.flyway.runtime.FlywayContainersSupplier; import io.quarkus.flyway.runtime.FlywayDataSourceBuildTimeConfig; +import io.quarkus.flyway.runtime.devconsole.FlywayDevConsoleRecorder; import io.vertx.core.MultiMap; import io.vertx.ext.web.RoutingContext; @@ -36,6 +39,12 @@ public DevConsoleRuntimeTemplateInfoBuildItem collectBeanInfo( curateOutcomeBuildItem); } + @BuildStep + @Record(value = RUNTIME_INIT, optional = true) + DevConsoleRouteBuildItem invokeEndpoint(FlywayDevConsoleRecorder recorder) { + return new DevConsoleRouteBuildItem("datasources", "POST", recorder.handler()); + } + @BuildStep DevConsoleRouteBuildItem invokeEndpoint(List generatorBuildItem, FlywayBuildTimeConfig buildTimeConfig,