Skip to content

Instantly share code, notes, and snippets.

@daubac402
Last active June 15, 2023 07:30
Show Gist options
  • Save daubac402/c891544c78bfcaf4d4e685e919df542d to your computer and use it in GitHub Desktop.
Save daubac402/c891544c78bfcaf4d4e685e919df542d to your computer and use it in GitHub Desktop.

Liquibase CLI notes

Installation

https://www.liquibase.com/download

Preparation

Download database driver (.jar file) then put it in /your_liquibase_installation_path/lib

For eg:
With MySQL, download from the Connector/J (mysql-connector-j-x.y.z.jar) from https://dev.mysql.com/downloads/connector/j/

Usage

Init project

https://docs.liquibase.com/commands/init/project.html Set up jdbc path, DB user, DB password, configurations, ... using

liquibase init project

It will create some config file, the most important is liquibase.properties

Generate existing database

Create your first Liquibase changelog file using https://docs.liquibase.com/commands/inspection/generate-changelog.html

liquibase generateChangeLog

Detail debug?

Add --log-level=debug parameter

liquibase <some args> --log-level=debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment