How do I trim my changelog?

Last updated: September 2, 2025

Often the changelog file is so large that it causes performance issues in your editor, or there are too many merge conflicts.

Procedure

The best way to handle this is to divide your changelog file into multiple files.

1

Create a main.changelog.xml file

Instead of having a singlechangelog.xmlfile with everything in it, create amain.changelog.xmlfile which uses theincludetag to reference other changelog files.

<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"
  xmlns:secure="http://www.liquibase.org/xml/ns/secure"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd
        http://www.liquibase.org/xml/ns/dbchangelog-ext
        http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd
        http://www.liquibase.org/xml/ns/secure
        http://www.liquibase.org/xml/ns/secure/liquibase-secure-latest.xsd">
  <include  file="com/example/news/news.changelog.xml"/>
  <include  file="com/example/directory/directory.changelog.xml"/>
</databaseChangeLog>
2

Run the liquibase update command

When you runliquibase update against themain.changelog.xmlfile, changesets incom/example/news/news.changelog.xmlwill run and then the changesets incom/example/directory/directory.changelog.xmlwill run. You can break up changesets by feature, release, or other ways.