I have tried the following
liquibase:generateChangeLog
- It generated the change log from my db.I need to generate the change-log
from my JPA entities
.
liquibase:diff
- It generates the change log for the difference between my db and JPA
entities. I cannot say that my db is always empty and I want to generate the create scripts which can be applied on fresh db.
How can I use Liquibase
to generate the scripts based on my JPA
entities only ?
Note : I am ok in providing the details about my db such as url,driver etc
If your IDE of choice is IntelliJ IDEA, I'd recommend using the JPA Buddy plugin to do this. It can generate Liquibase changelogs by comparing your Java model to the target DB.
So if your DB is empty, you'll get a changelog that describes your whole model. But it is also useful to keep your evolving model and your changelogs in sync.
Once you have it installed and have Liquibase as your Maven/Gradle dependency, you can generate a changelog like this:
Try to use liquibase-hibernate-plugin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With