-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add a config option to enable Flyway baseline feature #27744
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
Thanks for this. It seems however that the test does not compile |
bf81cb4
to
909a763
Compare
@geoand I was struggling to get the project imported correctly by intellij, it should be good now. I also rephrased the baselineOnMigrate config doc because the current description is a bit misleading |
909a763
to
df6c6f3
Compare
This comment has been minimized.
This comment has been minimized.
@geoand weird that FlywayExtensionMigrateAtStartTest is failing. H2 is not reset between tests ? |
I'm pretty sure it's not |
df6c6f3
to
c4b8f2c
Compare
extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayRecorder.java
Outdated
Show resolved
Hide resolved
extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayRecorder.java
Outdated
Show resolved
Hide resolved
*/ | ||
@ConfigItem | ||
public boolean baselineOnMigrate; | ||
|
||
/** | ||
* true to execute Flyway baseline automatically when the application starts when executed against an empty schema, false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently this command fails if the flyway_schema_history
table exists (see #27734 (comment)).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add a test with an existing table to be sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gastaldi , I made some test and here is my conclusion:
if the flyway_schema_history table exist and contains any element, everything is ok.
if the flyway_schema_history does not exist, everything is ok.
if the flyway_schema_history exist but is empty, then flyway.info().current() is null so we do execute the baseline and it is failing.
I will try to find a way to check if flyway_schema_history already exist in flyway api.
Take a look at how it is done in https://github.com/quarkusio/quarkus/blob/main/extensions/flyway/deployment/src/test/java/io/quarkus/flyway/test/FlywayExtensionCallbackTest.java |
For the record, I'm running full Quarkus builds locally (completely unrelated to this PR) and I'm seeing |
aa1271d
to
83e2549
Compare
This comment has been minimized.
This comment has been minimized.
@Ladicek I just changed the DB name in the connection string of my test and everything is working fine now |
83e2549
to
7d0c739
Compare
extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayRecorder.java
Outdated
Show resolved
Hide resolved
7d0c739
to
8a363d2
Compare
@gastaldi can you have another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments. I think it still needs some clarification
...ns/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java
Outdated
Show resolved
Hide resolved
...ns/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java
Outdated
Show resolved
Hide resolved
extensions/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayRecorder.java
Show resolved
Hide resolved
8a363d2
to
ff0a056
Compare
Thanks! Have the comments made during the review been addressed? cc @gastaldi |
If I remember well I addressed all the concerns. |
...ns/flyway/runtime/src/main/java/io/quarkus/flyway/runtime/FlywayDataSourceRuntimeConfig.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one minor observation
This comment has been minimized.
This comment has been minimized.
7f3adde
to
8aa8bde
Compare
fixed the typo. I will do this in another PR |
Could you squash the commits before we trigger CI? |
8aa8bde
to
6d024e8
Compare
@gastaldi I squashed it |
This comment has been minimized.
This comment has been minimized.
@gastaldi ping ? This looks like ready but it's waiting for your opinion |
6d024e8
to
214fc34
Compare
@Sanne thanks, I've rebased the branch, it should be good to merge once it passes |
This comment has been minimized.
This comment has been minimized.
@rmanibus because I forgot to merge this PR 3 months ago, this now needs to be changed to match the latest Flyway codebase. Can you have a look? |
214fc34
to
b2cded4
Compare
@gastaldi it is rebased ! |
Can you rebase and remove the merge commit? |
e5b52f7
to
89cb68d
Compare
@gastaldi done ! |
✔️ The latest workflow run for the pull request has completed successfully. It should be safe to merge provided you have a look at the other checks in the summary. |
Resolves #27734