Generator-jhipster: Add ability to skip liquibase dependencies and generation in the app generation

Created on 10 Oct 2019  路  10Comments  路  Source: jhipster/generator-jhipster

Overview of the feature request
As just done in the entity-generator, it would be great to add an option in order to skip liquibase usage avoiding to insert liquibase java dependency. Saving the option in the yo-rc.json, the entity generation automatically skips the changelog generation.

Motivation for or Use Case
In my business scenario, I have a flyway tool that manages the scripts migration. So I want to exclude liquibase support.

P.S. If you want I can provide a PR for this.

Thanks

  • [x] Checking this box is mandatory (this is just to show you read everything)
area needs-discussion

Most helpful comment

I agree with 1st solution too.

Liquibase is the solution supported and promoted by JHipster. If you want to use something else, either you modify the code after generation or automate that in a blueprint. As per our Policy 2, I don't think we should add more option regarding liquibase.

Also, don't misinterpret the new --skip-db-changelog option: its main goal is to help in your development workflow when you have already shipped some code in production and thus you will systematically disregard db changelogs generated by JHipster when you regenerate an entity (e.g. adding a new field). Because you don't need a full changelog that create the table, but a delta changelog that will alter the table.

All 10 comments

You basically want to disable liquibase, right?

You basically want to disable liquibase, right?

yes

Why? If it's for your generator, then you can remove it from your custom code (remove related files and/or entries). Unless I'm missing something of course...

Why? If it's for your generator, then you can remove it from your custom code (remove related files and/or entries). Unless I'm missing something of course...

Yes, I can remove it from my custom blueprint, but the option is already supported in the entity generator, so it is good to add that skip option also in the base blueprint generator, in order to avoid to add unuseful liquibase java dependencies from pom.xml or gradle file.
Besides, after generated the app and stored the option in the yo-rc.json, the entity generator finds the answer and automatically not generate changelogs.

Let's discuss.

I see 2 solutions for that.

1) remove directly from the blueprint, once it's generated
2) add an option in generator-jhipster to support it, for example jhipster --skip-liquibase, no additional question

The work would be:

  • store the option in .yo-rc.json
  • add new condition in different files (pom.xml, gradle file, logback, etc)
  • ignore faker, verify all the needles, etc.
  • check the option with MongoDB, Cassandra and Couchbase too

Then, if I use: jhipster --skip-liquibase and generate with default option, it won't work out of the box.

It's doable, and I understand the need.

What about, if later, another user wants an option to not generate file in aop/logging.
Should we add --skip-aop ?
Then later, another wants an option to skip audit files.
Should we add --skip-audit ?
Then, another hates Docker, doesn't want src/main/docker.
Should we add --skip-docker-compose ?

For these reasons, I think the 1st solution is better for the main generator-jhipster.

Hi @pascalgrimaud,
my considerations:

  1. it's obvious that I can delete the liquibase resources and dependencies from my custom blueprint, my question is to add that code in the standard jhipster generation.
  2. I have consider a --skip-liquibase option, and yes, another could want another options, but for the liquibase you have already provieded in the entity generation the liquibase skipping to not generate changelog.

Finally, just now with that entity customization there won't be faker data for the entites, and so out of box it does not work.

I don't understand:

Finally, just now with that entity customization there won't be faker data for the entites, and so out of box it does not work.

Which option doesn't work today, in generator-jhipster ? Can you provide me the main steps plz ?

I don't understand:

Finally, just now with that entity customization there won't be faker data for the entites, and so out of box it does not work.

Which option doesn't work today, in generator-jhipster ? Can you provide me the main steps plz ?

According this commit, the entity-generator could not generate changelog for liquibase in new entities. So for that however I haven't data or I can't use liquibase features in that generation.

I agree with 1st solution too.

Liquibase is the solution supported and promoted by JHipster. If you want to use something else, either you modify the code after generation or automate that in a blueprint. As per our Policy 2, I don't think we should add more option regarding liquibase.

Also, don't misinterpret the new --skip-db-changelog option: its main goal is to help in your development workflow when you have already shipped some code in production and thus you will systematically disregard db changelogs generated by JHipster when you regenerate an entity (e.g. adding a new field). Because you don't need a full changelog that create the table, but a delta changelog that will alter the table.

ok, well, I will close the issue, I provide that in my custom blueprint

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SudharakaP picture SudharakaP  路  3Comments

trajakovic picture trajakovic  路  4Comments

edvjacek picture edvjacek  路  3Comments

DanielFran picture DanielFran  路  3Comments

DanielFran picture DanielFran  路  3Comments