Hey @cristhiank
Thanks for the contribution, this is really exciting.
I was trying to see how we should go and make it even easier. Reading the Quarkus Flyway guide, it creates the dichotomy that you have to do different things depending on whether you want to run it native or not. We should eliminate these things and make sure the steps are the same whether in HotSpot or in GraalVM. For example they mention that you use the extension only for native work but not otherwise.
Which sucks from a Quarkus user experience as we want the same app to run on both without the user having to think.
Likewise, there is no bean enlisted to let the user simply @Inject Flyway flyway, instead there is a whole applicationscoped bean that people have to copy.
What I'd recommend is:
Flyway bean so user only have to do@Inject Flyway flyway;
public void migrate() {
flyway.migrate();
}
Even better, if we know that people want to alway call migrate at app startup time, we could enlist a bean with void onStart(@Observes StartupEvent ev) that calls migrate transparently for the user. That would be my nirvana.
I understand that some people might want more customized way to do it so we could have:
quarkus.database.flyway.* properties to override some values (liek the schema version I imagine?void onStart(@Observes StartupEvent ev) be a overridable bean (@Alternative or something like that)For the latter, we might not have that yet, but if we don't that's something we want CC @mkouba
Hi @emmanuelbernard ,
Thanks for your revision. I agree with everything you say. I was a bit conservative with the extension because I had no experience with Quarkus and I didn't know the vision in deep to be sure about what could be done and what couldn't, but now it's clearer and I can get it done.
I will be working on it and I will let you know if I get stuck on something.
Most helpful comment
Hi @emmanuelbernard ,
Thanks for your revision. I agree with everything you say. I was a bit conservative with the extension because I had no experience with Quarkus and I didn't know the vision in deep to be sure about what could be done and what couldn't, but now it's clearer and I can get it done.
I will be working on it and I will let you know if I get stuck on something.