Skip to content

Example project to demonstrate usage of liqubase-maven-plugin to generate automated database changelogs (in combination with spring-boot)

License

Notifications You must be signed in to change notification settings

lh39/liquibase-maven-demo

Repository files navigation

liquibase-maven-demo

This repository demonstrates the usage of the liquibase-maven-plugin in combination with spring boot to automate the generation of database changelogs and their automated execution.

In concrete, it shows:

  • generation of changelogs
  • execution of changelogs on application startup

The process works by scanning all packages defined in pom.xml, in this example "de.lh39", for entity classes. It then goes on to compare those definitions against the defined database connection in liquibase.properties. The differences are generated into a new changelog file.

Important configurations

Prerequisites

Start up the database to generate changelogs against or to apply migrations on.

docker-compose up -d

Run application

Run the spring boot application (automatically applies all existing migration changesets)

./mvnw spring-boot:run

Generate new changelogs

darwin / unix:

./liquibase-diff.sh CHANGELOG_NAME (e.g. "initial")

win:

liquibase-diff.cmd CHANGELOG_NAME (e.g. "initial")

About

Example project to demonstrate usage of liqubase-maven-plugin to generate automated database changelogs (in combination with spring-boot)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published