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.xml
file with everything in it, create amain.changelog.xml
file 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.xml
file, changesets incom/example/news/news.changelog.xml
will run and then the changesets incom/example/directory/directory.changelog.xml
will run. You can break up changesets by feature, release, or other ways.