Announcements

Database Change Log File

The root of all Liquibase changes is the databaseChangeLog file.

Available Attributes

AttributeDescription
logicalFilePathUse to override the file name and path when creating the unique identifier of change sets. Required when moving or renaming change logs.

Available Sub-Tags

TagDescription
preConditionsPre-conditions required to execute the change log. Read More
propertyValue to set property to, if not set by another means. Read More
changeSetThe change sets to execute. Read More
includeAdditional files containing change sets to execute. Read More

When the Liquibase migrator runs, it parses the databaseChangeLog tag. It first checks any preconditions specified. If any of the preconditions fail, the Liquibase will exit with an error message explaining what failed. Preconditions are useful for both documenting and enforcing expectations and assumptions of the changelog writer such as the DBMS to be run against or the user the changes are run as.

If all preconditions are met, Liquibase will then begin running changeSet and include tags in the order they appear in the databaseChangeLog file.

The XML schema for the databaseChangeLog tag is available at:

Some legacy XSDs are listed on the XML Format page.

Each changeSet contains an “id” tag and an “author” tag. These tags, along with the classpath location and name of the XML file create a unique identifier for that changeSet.

Sample Empty Change Log

<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd
    http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
</databaseChangeLog>
databaseChangeLog:
{
    "databaseChangeLog": [
    ]
}
--liquibase formatted sql

Missing, incomplete or wrong information? Please send a pull request