Is Possible to use Flyway instead of Liquibase with JHipster?
Is Possible to use Flyway instead of Liquibase with JHipster?
A few months ago, I had an opportunity of working with Flyway. Flyway is straightforward for anyone who knows SQL. It is far easier to use native SQL statements in a Flyway DB change file than using XML in a Liquibase DB change files. I hope there is at least an option of DB refactoring tool so that people can use Flyway if they like.
1 Answer
1
It is possible, but you will have to implement it yourself. There is no Flyway code anywhere in the generator.
Luckily, it's fully supported by Spring Boot (Flyway docs). Flyway also has a docs page for Spring Boot to get started.
Thanks Jon for your input. If I make a change on an entity class, I need to create a Flyway DB change file accordingly, right? I have a JHipster project which uses PostgreSQL native non-standard SQL data types, such as JSON and array. Mannual approach may be better than the generator approach since the generator approach can't handle any of non-standard datatype anyway, right?
– vic
Aug 27 at 1:29
Yes if you need any database migrations for Flyway, you will need to add those files. In regards to your second question, it depends on your database structure. You may want to manually add the entities if you have JSON/Array types, but you can do that on top of the generated project (just dont generate that specific entity)
– Jon Ruddell
Aug 27 at 1:33
For the non-standard data types, my approach is to have them as a String first in an entity which can be processed by JHipster and change their data types later. I am thinking that the Flyway manual script approach may be better in the way.
– vic
Aug 27 at 2:09
You can also edit the liquibase changelog to support the other data types (for example, liquibase supports
jsonb). I'm not sure if it's simple to mix liquibase and flyway.– Jon Ruddell
Aug 27 at 17:46
jsonb
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
You can also use SQL with Liquibase even though this is no what JHipster generates.
– Gaël Marziou
Aug 27 at 9:41