XML changelog example

Last updated: September 2, 2025

Liquibase supports XML as a format for storing your Changelog files. There is more information about the XML format in the FAQ.

XSD support

XML Schema Definitions (XSDs) are available for each Liquibase version. However, if you use the earliest versions of XSD files, any new features that require new XML tags will not be available. Since there are no changelog format changes in patch versions, there are only XSD files that correspond tomajor.minorversions.

Liquibase contains XSD files locally and does not need to retrieve them from the internet to validate your XML. If you use custom XSD files in your changelog, Liquibase needs to download them to validate XML. By default, Liquibase does not automatically download non-local XSD files. To change this behavior, set theliquibase.secureParsingparameter tofalsein the Liquibase properties file, in the CLI, withJAVA_OPTS, or as an environment variable. For more information, seeWorking with Command Parameters.

Alternatively, add your custom XSD to a JAR in Liquibase's classpath using the format<hostname>/<path>. For example, if your XSD has the locationhttps://<hostname>.com/<path>/changelog.xsd, store your XSD JAR in the path/<hostname>.com/<path>/changelog.xsd.

To disable XSD validation for your changelogs, set thevalidate-xml-changelog-filesparameter tofalse.

Liquibase extension XSDs

If you use aLiquibase extensionthat includes additional change tags, check the extension documentation to find out if they provide a XSD. If they do not, you can use the XSD atdbchangelog-ext.xsdwhich allows any nested tag and attribute.

Example

This example changelog contains changesets that:

  1. Create a newpersontable with columnsid,firstname,lastname, andstate

  2. Add a newusernamecolumn to thepersontable

  3. Create a lookup tablestateusing data fromperson

The example precondition requires the user making the deployment to beliquibase.

changelog example
loading

You can add XML comments outside changesets using the format <!-- my comment -->.

XML changelog example - Liquibase