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

quarkus-flyway: Java-Migration does not get picked up on live reload #36299

Closed
mschorsch opened this issue Oct 5, 2023 · 5 comments · Fixed by #36371
Closed

quarkus-flyway: Java-Migration does not get picked up on live reload #36299

mschorsch opened this issue Oct 5, 2023 · 5 comments · Fixed by #36371
Labels
area/flyway kind/bug Something isn't working
Milestone

Comments

@mschorsch
Copy link

mschorsch commented Oct 5, 2023

Describe the bug

Migrations written in Java (Java-based migrations) does not get picked up on live reload.

✔️ When Quarkus is started, both migrations are executed correctly (./mvnw quarkus:dev):

2023-10-05 05:59:05,899 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread) Flyway Community Edition 9.21.2 by Redgate
2023-10-05 05:59:05,906 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread) See release notes here: https://rd.gt/416ObMi
2023-10-05 05:59:05,911 INFO  [org.fly.cor.int.lic.VersionPrinter] (Quarkus Main Thread)
2023-10-05 05:59:05,935 INFO  [org.fly.cor.FlywayExecutor] (Quarkus Main Thread) Database: jdbc:postgresql://localhost:56077/quarkus (PostgreSQL 14.9)
2023-10-05 05:59:06,003 INFO  [org.fly.cor.int.sch.JdbcTableSchemaHistory] (Quarkus Main Thread) Schema history table "public"."flyway_schema_history" does not exist yet
2023-10-05 05:59:06,011 INFO  [org.fly.cor.int.com.DbValidate] (Quarkus Main Thread) Successfully validated 2 migrations (execution time 00:00.031s)
2023-10-05 05:59:06,047 INFO  [org.fly.cor.int.sch.JdbcTableSchemaHistory] (Quarkus Main Thread) Creating Schema History table "public"."flyway_schema_history" ...
2023-10-05 05:59:06,131 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": << Empty Schema >>
2023-10-05 05:59:06,143 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1.0.0 - Quarkus"
2023-10-05 05:59:06,176 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1.1.0 - Insert"
2023-10-05 05:59:06,207 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Successfully applied 2 migrations to schema "public", now at version v1.1.0 (execution time 00:00.024s)

✔️ If i change something in the java migration class (V1_1_0__Insert.java), the migration/validation is performed as expexted.

2023-10-05 06:04:38,010 INFO  [org.fly.cor.FlywayExecutor] (Quarkus Main Thread) Database: jdbc:postgresql://localhost:56077/quarkus (PostgreSQL 14.9)
2023-10-05 06:04:38,031 INFO  [org.fly.cor.int.com.DbValidate] (Quarkus Main Thread) Successfully validated 2 migrations (execution time 00:00.007s)
2023-10-05 06:04:38,075 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": 1.0.0
2023-10-05 06:04:38,081 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1.1.0 - Insert"
2023-10-05 06:04:38,116 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Successfully applied 1 migration to schema "public", now at version v1.1.0 (execution time 00:00.009s)

❌ However, if I perform a live reload ([s] - Force restart or any change in another class other then the migration class), the Java migration/validation is not performed.

2023-10-05 06:03:29,274 INFO  [org.fly.cor.int.com.cle.CleanExecutor] (Quarkus Main Thread) Successfully dropped pre-schema database level objects (execution time 00:00.000s)
2023-10-05 06:03:29,319 INFO  [org.fly.cor.int.com.cle.CleanExecutor] (Quarkus Main Thread) Successfully cleaned schema "public" (execution time 00:00.041s)
2023-10-05 06:03:29,347 INFO  [org.fly.cor.int.com.cle.CleanExecutor] (Quarkus Main Thread) Successfully cleaned schema "public" (execution time 00:00.027s)
2023-10-05 06:03:29,349 INFO  [org.fly.cor.int.com.cle.CleanExecutor] (Quarkus Main Thread) Successfully dropped post-schema database level objects (execution time 00:00.000s)
2023-10-05 06:03:29,369 INFO  [org.fly.cor.int.sch.JdbcTableSchemaHistory] (Quarkus Main Thread) Creating Schema History table "public"."flyway_schema_history" ...
2023-10-05 06:03:29,429 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Current version of schema "public": << Empty Schema >>
2023-10-05 06:03:29,438 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Migrating schema "public" to version "1.0.0 - Quarkus"
2023-10-05 06:03:29,463 INFO  [org.fly.cor.int.com.DbMigrate] (Quarkus Main Thread) Successfully applied 1 migration to schema "public", now at version v1.0.0 (execution time 00:00.010s)

How to Reproduce?

reproducer.zip

Output of java -version

Java 17

Quarkus version or git rev

3.4.2

Build tool (ie. output of mvnw --version or gradlew --version)

Maven

@mschorsch mschorsch added the kind/bug Something isn't working label Oct 5, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 5, 2023

/cc @cristhiank (flyway), @gastaldi (flyway), @geoand (flyway), @gsmet (flyway)

@gsmet
Copy link
Member

gsmet commented Oct 6, 2023

Interesting report but also very odd :). I'm not completely sure what could go wrong.

Is it a new behavior and we broke something or it has always been like that for you?

@mschorsch
Copy link
Author

@gsmet I don't know. We tried flyway java migrations for the first time.

@geoand
Copy link
Contributor

geoand commented Oct 9, 2023

I'll have a look soon

geoand added a commit to geoand/quarkus that referenced this issue Oct 10, 2023
@geoand
Copy link
Contributor

geoand commented Oct 10, 2023

#36371 is the fix

gsmet added a commit that referenced this issue Oct 10, 2023
Fix issue in Java migration in dev-mode
@quarkus-bot quarkus-bot bot added this to the 3.5 - main milestone Oct 10, 2023
@gsmet gsmet modified the milestones: 3.5.0.CR1, 3.4.3 Oct 11, 2023
gsmet pushed a commit to gsmet/quarkus that referenced this issue Oct 11, 2023
@aloubyansky aloubyansky modified the milestones: 3.4.3, 3.2.8.Final Oct 25, 2023
aloubyansky pushed a commit to aloubyansky/quarkus that referenced this issue Oct 25, 2023
benkard pushed a commit to benkard/mulkcms2 that referenced this issue Nov 12, 2023
This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [flow-bin](https://github.com/flowtype/flow-bin) ([changelog](https://github.com/facebook/flow/blob/master/Changelog.md)) | devDependencies | minor | [`^0.217.0` -> `^0.219.0`](https://renovatebot.com/diffs/npm/flow-bin/0.217.2/0.219.0) |
| [io.hypersistence:hypersistence-utils-hibernate-62](https://github.com/vladmihalcea/hypersistence-utils) | compile | minor | `3.5.3` -> `3.6.0` |
| [io.quarkus:quarkus-maven-plugin](https://github.com/quarkusio/quarkus) | build | patch | `3.4.2` -> `3.4.3` |
| [io.quarkus:quarkus-universe-bom](https://github.com/quarkusio/quarkus-platform) | import | patch | `3.4.2` -> `3.4.3` |

---

### Release Notes

<details>
<summary>flowtype/flow-bin</summary>

### [`v0.219.0`](flow/flow-bin@1268ec5...c184c5d)

[Compare Source](flow/flow-bin@1268ec5...c184c5d)

### [`v0.218.1`](flow/flow-bin@12afce4...1268ec5)

[Compare Source](flow/flow-bin@12afce4...1268ec5)

### [`v0.218.0`](flow/flow-bin@dc93913...12afce4)

[Compare Source](flow/flow-bin@dc93913...12afce4)

</details>

<details>
<summary>vladmihalcea/hypersistence-utils</summary>

### [`v3.6.0`](https://github.com/vladmihalcea/hypersistence-utils/blob/HEAD/changelog.txt#Version-360---October-12-2023)

\================================================================================

Implement QueryStackTraceLogger using StackWalker [#&#8203;659](vladmihalcea/hypersistence-utils#659)

Add JFR based query logger [#&#8203;658](vladmihalcea/hypersistence-utils#658)

Adds support for using MonetaryAmount in [@&#8203;ElementCollection](https://github.com/ElementCollection) [#&#8203;652](vladmihalcea/hypersistence-utils#652)

</details>

<details>
<summary>quarkusio/quarkus</summary>

### [`v3.4.3`](https://github.com/quarkusio/quarkus/releases/tag/3.4.3)

[Compare Source](quarkusio/quarkus@3.4.2...3.4.3)

##### Complete changelog

-   [#&#8203;36408](quarkusio/quarkus#36408) - Ensure that SSE builder works in native
-   [#&#8203;36404](quarkusio/quarkus#36404) - Do not exclude properties from recording that are available in sources that should always be included
-   [#&#8203;36403](quarkusio/quarkus#36403) - IBM Db2 - Register resource bundle classes for reflection
-   [#&#8203;36402](quarkusio/quarkus#36402) - Native Picocli build breaks SSE client
-   [#&#8203;36399](quarkusio/quarkus#36399) - quarkus-jdbc-db2: resource bundle missing
-   [#&#8203;36377](quarkusio/quarkus#36377) - Allow `@ClientHeaderParam` to override User-Agent
-   [#&#8203;36371](quarkusio/quarkus#36371) - Fix issue in Java migration in dev-mode
-   [#&#8203;36351](quarkusio/quarkus#36351) - Properly handle invalid response body errors in Reactive REST Client
-   [#&#8203;36329](quarkusio/quarkus#36329) - Custom User-Agent header ignored
-   [#&#8203;36326](quarkusio/quarkus#36326) - Cannot load fixed or default YAML configuration when running native build
-   [#&#8203;36302](quarkusio/quarkus#36302) - Fix headers and preambles in all guides and reintroduce some keywords
-   [#&#8203;36299](quarkusio/quarkus#36299) - quarkus-flyway: Java-Migration does not get picked up on live reload
-   [#&#8203;36290](quarkusio/quarkus#36290) - Fixed URL for configuring JSON support
-   [#&#8203;36257](quarkusio/quarkus#36257) - Rest client call hangs when receiving an invalid chunked response and does not release resources (e.g. Bulkhead semaphore)
-   [#&#8203;36147](quarkusio/quarkus#36147) - Bump org.eclipse.parsson:parsson from 1.1.2 to 1.1.4
-   [#&#8203;36096](quarkusio/quarkus#36096) - Build cache - Use notCacheableBecause instead of storeEnabled
-   [#&#8203;35929](quarkusio/quarkus#35929) - Do not store build cache for core extensions having config
-   [#&#8203;35927](quarkusio/quarkus#35927) - Build cache - Core extensions containing config shouldn't be cached
-   [#&#8203;35769](quarkusio/quarkus#35769) - Default response content type using GraphQL spec

</details>

<details>
<summary>quarkusio/quarkus-platform</summary>

### [`v3.4.3`](quarkusio/quarkus-platform@3.4.2...3.4.3)

[Compare Source](quarkusio/quarkus-platform@3.4.2...3.4.3)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

👻 **Immortal**: This MR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
holly-cummins pushed a commit to holly-cummins/quarkus that referenced this issue Feb 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flyway kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants