In this tutorial, we will cover a few simple mechanisms Liquibase uses to track, version, and deploy changes to get an understanding of how Liquibase works.
Liquibase uses a changelog to explicitly list database changes in order. The changelog acts as a ledger of changes and contains a list of changeSets (units of change) that Liquibase can execute on a database.
View our Database changelog File and changeSet Tag topics for more information.
Liquibase tracks which changeSets have or have not been deployed in a tracking table called a DATABASECHANGELOG
. If your database does not already contain a tracking table, Liquibase will create it for you.
Liquibase also prevents conflicts from different callers’ updates on a secondary table called DATABASECHANGELOGLOCK
.
View our DATABASECHANGELOG Table and DATABASECHANGELOCK Table topics for more information.
changelogs and tracking tables allow Liquibase to:
Liquibase also has advanced features such as contexts, labels, and preconditions to precisely control when and where a changeSet is deployed.
Note: To assist with projects where you are not starting with a blank database, Liquibase has a feature to generate a changelog to represent the current state of the database schema.
In this tutorial we covered: