suppress-liquibase-sql
--suppress-liquibase-sql
is a global Boolean parameter. When set to true
, Liquibase excludes DATABASECHANGELOG table and DATABASECHANGELOGHISTORY table SQL from the console and log output of *-sql
commands, such as update-sql
and rollback-sql
. It is available in Liquibase 4.29.2 and later. The default value is false
.
Uses
The Liquibase *-sql
commands help you identify potential problems with SQL you're planning to deploy to your database. For example, the update-count-sql
command displays the SQL that would be generated by running the update-count
command.
By default, Liquibase prints all SQL it generates to the console and logs. This includes SQL for your database tables as well as the SQL to update the internal Liquibase tracking tables (DBCL and DBCLH).
You may need to use *-sql
commands to review the SQL to be run against your database, but don't want to see any information about the tracking tables. To exclude tracking table SQL, set --suppress-liquibase-sql
to true
.
Syntax
You can set this parameter in the following ways:
Option | Syntax |
---|---|
Liquibase properties file (defaults file) |
|
Global flow file argument (example) |
|
Global CLI parameter |
|
JVM system property (JAVA_OPTS Environment Variable) |
|
Liquibase Environment Variables |
|
For more information, see Working with Command Parameters.
Output
--suppress-liquibase-sql=false
Starting Liquibase at 11:15:55 using Java 17.0.6 (version 4.30.0 #4943 built at 2024-10-31 17:00+0000)
Liquibase Version: 4.30.0
Liquibase Pro 4.30.0 by Liquibase licensed to Liquibase until Wed Apr 30 20:00:00 EDT 2025
-- Create Database Lock Table
CREATE TABLE PUBLIC.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BOOLEAN NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR(255), CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID));
-- Initialize Database Lock Table
DELETE FROM PUBLIC.DATABASECHANGELOGLOCK;
INSERT INTO PUBLIC.DATABASECHANGELOGLOCK (ID, LOCKED) VALUES (1, FALSE);
-- Lock Database
UPDATE PUBLIC.DATABASECHANGELOGLOCK SET LOCKED = TRUE, LOCKEDBY = 'LAPTOP-74GFS93J (10.0.0.211)', LOCKGRANTED = NOW() WHERE ID = 1 AND LOCKED = FALSE;
-- Create Database Change Log Table
CREATE TABLE PUBLIC.DATABASECHANGELOG (ID VARCHAR(255) NOT NULL, AUTHOR VARCHAR(255) NOT NULL, FILENAME VARCHAR(255) NOT NULL, DATEEXECUTED TIMESTAMP NOT NULL, ORDEREXECUTED INT NOT NULL, EXECTYPE VARCHAR(10) NOT NULL, MD5SUM VARCHAR(35), DESCRIPTION VARCHAR(255), COMMENTS VARCHAR(255), TAG VARCHAR(255), LIQUIBASE VARCHAR(20), CONTEXTS VARCHAR(255), LABELS VARCHAR(255), DEPLOYMENT_ID VARCHAR(10));
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: example-changelog.xml
-- Ran at: 12/11/24, 11:15 AM
-- Against: DBUSER@jdbc:h2:tcp://localhost:9090/mem:dev
-- Liquibase version: 4.30.0
-- *********************************************************************
-- Changeset example-changelog.xml::1::your.name
-- example-comment
CREATE TABLE PUBLIC.person (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(50) NOT NULL, address1 VARCHAR(50), address2 VARCHAR(50), city VARCHAR(30), CONSTRAINT PK_PERSON PRIMARY KEY (id));
INSERT INTO PUBLIC.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('1', 'your.name', 'example-changelog.xml', NOW(), 1, '9:884ea70a8e61427b7b1a217a62954c48', 'createTable tableName=person', 'example-comment', 'EXECUTED', 'example-context', 'example-label', '4.30.0', '3933756962');
-- Changeset example-changelog.xml::2::your.name
-- example-comment
CREATE TABLE PUBLIC.company (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(50) NOT NULL, address1 VARCHAR(50), address2 VARCHAR(50), city VARCHAR(30), CONSTRAINT PK_COMPANY PRIMARY KEY (id));
INSERT INTO PUBLIC.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('2', 'your.name', 'example-changelog.xml', NOW(), 2, '9:0160e0cb8fe825cbd40207ef539e0d08', 'createTable tableName=company', 'example-comment', 'EXECUTED', 'example-context', 'example-label', '4.30.0', '3933756962');
-- Changeset example-changelog.xml::3::other.dev
-- example-comment
ALTER TABLE PUBLIC.person ADD country VARCHAR(2);
INSERT INTO PUBLIC.DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DESCRIPTION, COMMENTS, EXECTYPE, CONTEXTS, LABELS, LIQUIBASE, DEPLOYMENT_ID) VALUES ('3', 'other.dev', 'example-changelog.xml', NOW(), 3, '9:cf75e37ee64b860fb5d1d1bc943c75fb', 'addColumn tableName=person', 'example-comment', 'EXECUTED', 'example-context', 'example-label', '4.30.0', '3933756962');
-- Release Database Lock
UPDATE PUBLIC.DATABASECHANGELOGLOCK SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1;
Liquibase command 'update-sql' was executed successfully.
--suppress-liquibase-sql=true
Starting Liquibase at 11:17:12 using Java 17.0.6 (version 4.30.0 #4943 built at 2024-10-31 17:00+0000)
Liquibase Version: 4.30.0
Liquibase Pro 4.30.0 by Liquibase licensed to Liquibase until Wed Apr 30 20:00:00 EDT 2025
-- Create Database Lock Table
-- Initialize Database Lock Table
-- Lock Database
-- Create Database Change Log Table
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: example-changelog.xml
-- Ran at: 12/11/24, 11:17 AM
-- Against: DBUSER@jdbc:h2:tcp://localhost:9090/mem:dev
-- Liquibase version: 4.30.0
-- *********************************************************************
-- Changeset example-changelog.xml::1::your.name
-- example-comment
CREATE TABLE PUBLIC.person (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(50) NOT NULL, address1 VARCHAR(50), address2 VARCHAR(50), city VARCHAR(30), CONSTRAINT PK_PERSON PRIMARY KEY (id));
-- Changeset example-changelog.xml::2::your.name
-- example-comment
CREATE TABLE PUBLIC.company (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, name VARCHAR(50) NOT NULL, address1 VARCHAR(50), address2 VARCHAR(50), city VARCHAR(30), CONSTRAINT PK_COMPANY PRIMARY KEY (id));
-- Changeset example-changelog.xml::3::other.dev
-- example-comment
ALTER TABLE PUBLIC.person ADD country VARCHAR(2);
-- Release Database Lock
Liquibase command 'update-sql' was executed successfully.
Related links
--show-banner
--sql-log-level
--sql-show-sql-warnings