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 to major.minor versions.
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 the liquibase.secureParsing parameter to false in the Liquibase properties file, in the CLI, with JAVA_OPTS, or as an environment variable. For more information, see Working 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 location https://<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 the validate-xml-changelog-files parameter to false.
Liquibase extension XSDs
If you use a Liquibase extension that 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 at dbchangelog-ext.xsd which allows any nested tag and attribute.
Example
This example changelog contains changesets that:
Create a new
persontable with columnsid,firstname,lastname, andstateAdd a new
usernamecolumn to thepersontableCreate a lookup table
stateusing data fromperson
The example precondition requires the user making the deployment to be liquibase.
changelog example
You can add XML comments outside changesets using the format <!-- my comment -->.