Here is the development workflow:
- Modify your JPA entity (add a field, a relationship, etc.)
- Compile your application (this works on the compiled Java code, so don’t forget to compile!)
- Run
./mvnw liquibase:diff
(or./mvnw compile liquibase:diff
to compile before) - A new “change log” is created in your
src/main/resources/config/liquibase/changelog
directory - Review this change log and add it to your
src/main/resources/config/liquibase/master.xml
file, so it is applied the next time you run your application
If you use Gradle instead of Maven, you can use the same workflow by running ./gradlew liquibaseDiffChangelog -PrunList=diffLog
,
and change the database configuration in build.gradle in the liquibase configuration if required.