Run a policy check

Last updated: September 2, 2025

The Liquibase Policy Checks feature allows you to build quality, security, and compliance into your database development workflow by utilizing the checks command. It operates by running checks against a changelog and customizing the Check's configuration, which will notify you when it identifies the specified scenario.

Note: This is a Liquibase Secure feature, so you need a Liquibase Secure License Key to use it.

Run checks against your changelog with the default configuration

The policy checks capability supports all changelog formats. This instruction includes a formatted SQL changelog. If you use your own changelog, example output might differ.

1

Create a new changelog.sql file

Add the following to the new changelog.sql file:

--liquibase formatted sql --changeset your.name:1 labels:v0 context:all create table person ( id int primary key, name varchar(50) not null, address1 varchar(50), address2 varchar(50), city varchar(30) ) --changeset your.name:2 labels:v0 context:all create table company ( id int primary key, name varchar(50) not null, address1 varchar(50), address2 varchar(50), city varchar(30) ) --changeset other.dev:3 labels:v0 context:all alter table person add column country varchar(2) --changeset other.dev:4 labels:v0 context:all drop table person;

2

Open your CLI and navigate to the directory with the changelog file that you intend to use.

Add the following to the new changelog.sql file:

--liquibase formatted sql --changeset your.name:1 labels:v0 context:all create table person ( id int primary key, name varchar(50) not null, address1 varchar(50), address2 varchar(50), city varchar(30) ) --changeset your.name:2 labels:v0 context:all create table company ( id int primary key, name varchar(50) not null, address1 varchar(50), address2 varchar(50), city varchar(30) ) --changeset other.dev:3 labels:v0 context:all alter table person add column country varchar(2) --changeset other.dev:4 labels:v0 context:all drop table person;

3

Run the liquibase checks run command

Add the following to the new changelog.sql file:

--liquibase formatted sql --changeset your.name:1 labels:v0 context:all create table person ( id int primary key, name varchar(50) not null, address1 varchar(50), address2 varchar(50), city varchar(30) ) --changeset your.name:2 labels:v0 context:all create table company ( id int primary key, name varchar(50) not null, address1 varchar(50), address2 varchar(50), city varchar(30) ) --changeset other.dev:3 labels:v0 context:all alter table person add column country varchar(2) --changeset other.dev:4 labels:v0 context:all drop table person;

Run a policy check - Liquibase