-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Flyway with "multiple datasources" does not migrate at start #9415
Comments
I'll take a look |
I am using the absolute latest Quarkus from
Which suggests to me that it's working (I am not really a Flyway user so I might be missing something). |
It says "Current version of schema "public": << Empty Schema >>" and " Schema "public" is up to date. No migration necessary." which means nothing is applied. If you look at the database it has the Flyway table, but no version - Should be "V1.0.0__create_fruits.sql" for both databases. Before it worked fine and both scripts were picked up on startup and there was a table "fruits" created by the scripts in both databases. Now there is no table created. Should be something like:
|
Turns out that this problem is rather serious. What I am seeing is that when multiple datasources are being used, dev-mode does not populate the named datasources of Here is a screenshot from the debugger of the non-working dev-mode (notice the and here is the screenshot of the same point in the code for a prod-mode jar: I could keep digging to try and figure out what the problem is, but I would appreciate some input from @stuartwdouglas and @dmlloyd |
Same when using the 'database' profile that is required for the quickstart when using a database per tenant. Example in native mode which also does not work:
|
In any case, if no one beats me to it, I'll continue debugging tomorrow |
It's probably related to
86c18ff
,
although without this commit dev mode injection of beans does not work at
all, so you can't just revert it to check.
I think this is the same issue as
#9296 .
I am going to investigate more, however this code is really complex so it
may take some time.
Stuart
…On Tue, 19 May 2020 at 03:31, Georgios Andrianakis ***@***.***> wrote:
In any case, if no one beats me to it, I'll continue debugging tomorrow
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9415 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACQG62XZVVDKEJUB7V7HXDRSFWIDANCNFSM4NEEOY2A>
.
|
The issue is here:
86c18ff#diff-7fbde848a99a6f09343b25f15981ee40R618
Something to do with the converters, but I am still looking into it.
Stuart
…On Tue, 19 May 2020 at 13:11, Stuart Douglas ***@***.***> wrote:
It's probably related to
86c18ff ,
although without this commit dev mode injection of beans does not work at
all, so you can't just revert it to check.
I think this is the same issue as
#9296 .
I am going to investigate more, however this code is really complex so it
may take some time.
Stuart
On Tue, 19 May 2020 at 03:31, Georgios Andrianakis <
***@***.***> wrote:
> In any case, if no one beats me to it, I'll continue debugging tomorrow
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#9415 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/AACQG62XZVVDKEJUB7V7HXDRSFWIDANCNFSM4NEEOY2A>
> .
>
|
I'll look as well |
I think I have a fix #9296
…On Tue, 19 May 2020 at 15:31, Georgios Andrianakis ***@***.***> wrote:
I'll look as well
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#9415 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACQG623HQ6VBEXEWLYKI43RSIKSVANCNFSM4NEEOY2A>
.
|
Cool, looking |
I tested with the new quickstart project again and dev mode works now fine. Unfortunately in native mode the profile is still not picked up (Flyway is not started for migartion). Starting with
Same in native mode with
It seems again to be related to the profile, as Flyway correctly shows up if no profile is used with
Seems as if the fix only was half the way. @stuartwdouglas @geoand Any idea? |
The fix was indeed only for dev-mode. Can you please open a new issue for the problem you are seeing in native? |
OK |
Describe the bug
There are two datasources that should be be migrated on startup by Flyway, but the scripts are not executed. From the logs it can bee seen that the directories are recognized correctly by the Flyway extension, but not applied later. This has been working before (~1.3.x) and stopped working with current master source.
Example (database/mycompany)
Expected behavior
The scripts in "src/main/resources/database" should be used for migration on startup.
Actual behavior
The scripts in "src/main/resources/database" are not applied on startup.
To Reproduce
Steps to reproduce the behavior:
Configuration
See https://github.com/michael-schnell/quarkus-quickstarts/blob/master/hibernate-orm-quickstart-multi-tenancy/src/main/resources/application.properties
Log
Environment (please complete the following information):
Additional context
I'm currently preparing a quickstart for the new Hibernate multi-tenancy feature. This example was already working fine with 999-SNAPSHOT from source ~1.3.x, but it fails now with current Quarkus master source. The problem is actually not related to the new feature as it happens before anything from that code is executed. The problem is just the missing Flyway migration. It seems to be something that changed between ~1.3.x and the current master most likely in the Flyway extension.
The text was updated successfully, but these errors were encountered: