generated-changeset-ids-contains-description parameter

The generated-changeset-ids-contains-description global parameter is a Boolean that determines whether Liquibase includes changeset descriptions in changelogs generated with the generateChangeLog command in addition to changeset IDs. The default value is false.

Uses

If you set generated-changeset-ids-contains-description to true and run the generateChangeLog command, Liquibase includes a human-readable description of each changeset as part of the value of the id attribute in the changelog it generates. Otherwise, it only includes the changeset ID, which is made of a randomly generated value followed by the current count of changesets in the changelog.

Note: Liquibase uses the id attribute to give each change a unique identifier, not to specify the order changes are run. It can be an integer or a string.

Setting the generated-changeset-ids-contains-description parameter

You can set generated-changeset-ids-contains-description in four ways:

  • As a JVM system property
  • In your liquibase.properties file
  • As a global parameter in the CLI
  • As an environment variable (Liquibase Pro)

Java system property

You can set generated-changeset-ids-contains-description as a Java system property by using the JAVA_OPTS Environment Variable in your command line. The syntax on Mac/Linux is as follows:

JAVA_OPTS=-Dliquibase.generatedChangesetIdsContainsDescription=<true|false> && liquibase generate-changelog --changelog-file=dbchangelog.xml

The syntax on Windows requires the set command:

set JAVA_OPTS=-Dliquibase.generatedChangesetIdsContainsDescription=<true|false> && liquibase generate-changelog --changelog-file=dbchangelog.xml

liquibase.properties parameter

In Liquibase 4.1+, you can set generated-changeset-ids-contains-description by adding the following to your liquibase.properties file:

liquibase.generatedChangesetIdsContainsDescription: <true|false>

CLI global parameter

You can use generated-changeset-ids-contains-description as a global parameter in your command line with a single Liquibase command, such as generateChangeLog:

liquibase --generated-changeset-ids-contains-description=<true|false> generate-changelog --changelog-file=dbchangelog.xml

Environment variable (Liquibase Pro)

If you use Liquibase Pro, you can set generated-changeset-ids-contains-description as an environment variable. The syntax on Mac/Linux is as follows:

LIQUIBASE_GENERATED_CHANGESET_IDS_CONTAINS_DESCRIPTION=<true|false>

The syntax on Windows requires the set command:

set LIQUIBASE_GENERATED_CHANGESET_IDS_CONTAINS_DESCRIPTION=<true|false>

Note: The commands shown above only apply to the current shell. If you need to pass an environment variable to a child process without affecting the parent process, you can use the export command on Mac/Linux or the setx command on Windows.

Output

If you use the generateChangeLog command with generated-changeset-ids-contains-description set to true, the output looks like:

<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.1.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
	<changeSet author="adrian (generated)" id="l14y-1 (createTable tableName=TEST_TABLE)">
		<createTable tableName="TEST_TABLE">
			<column name="TEST_COLUMN" type="VARCHAR(2147483647)"/>
			<column name="TEST_ID" type="INT">
				<constraints nullable="false" primaryKey="true" primaryKeyName="PK_TEST_TABLE"/>
			</column>
		</createTable>
	</changeSet>
</databaseChangeLog>

Related links