Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push Flyway integration to the next level #6240

Closed
x80486 opened this issue Dec 17, 2019 · 4 comments · Fixed by #6307
Closed

Push Flyway integration to the next level #6240

x80486 opened this issue Dec 17, 2019 · 4 comments · Fixed by #6307
Assignees
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Milestone

Comments

@x80486
Copy link
Contributor

x80486 commented Dec 17, 2019

Description

Since Quarkus has already support for Flyway, it would be great to support some other "operations" (or commands) to make our life easier while dealing with it:

  • quarkus.flyway.validate-on-migrate — Option to automatically call validate when performing the migration
  • quarkus.flyway.out-of-order — Allow migrations to be run out of order or not
  • quarkus.flyway.clean-disabled — Whether to disable cleaning of the database; extremely useful during development and when tests are about (or prepared to) be run, so we don't have to do this manually all the time
@x80486 x80486 added the kind/enhancement New feature or request label Dec 17, 2019
@gastaldi gastaldi added the good first issue Good for newcomers label Dec 18, 2019
@gastaldi
Copy link
Contributor

There is quarkus.flyway.clean-at-start already, which I suppose it does what your quarkus.flyway.clean-disabled intends?

@gsmet
Copy link
Member

gsmet commented Dec 18, 2019

Would you be willing to contribute some of that? It doesn’t look too hard.

@gastaldi
Copy link
Contributor

It would be great if you could contribute @x80486, Here is a small diff of how quarkus.flyway.validate-on-migrate would be implemented:

git a/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayCreator.java b/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayCreator.java
index 0f0ea851e..cb65d82ab 100644
--- a/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayCreator.java
+++ b/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayCreator.java
@@ -26,6 +26,8 @@ class FlywayCreator {
         flywayRuntimeConfig.repeatableSqlMigrationPrefix.ifPresent(configure::repeatableSqlMigrationPrefix);
 
         configure.baselineOnMigrate(flywayRuntimeConfig.baselineOnMigrate);
+        configure.validateOnMigrate(flywayRuntimeConfig.validateOnMigrate);
+
         flywayRuntimeConfig.baselineVersion.ifPresent(configure::baselineVersion);
         flywayRuntimeConfig.baselineDescription.ifPresent(configure::baselineDescription);
 
diff --git a/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java b/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java
index dbf08839a..3bd9d8e46 100644
--- a/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java
+++ b/extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java
@@ -82,6 +82,13 @@ public final class FlywayDataSourceRuntimeConfig {
     @ConfigItem
     public boolean baselineOnMigrate;
 
+    /**
+     * TODO: Add Javadoc
+     */
+    @ConfigItem
+    public boolean validateOnMigrate;
+
     /**
      * The initial baseline version.
      */

@x80486
Copy link
Contributor Author

x80486 commented Dec 18, 2019

OK, I'll take it 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants