Connect your changelogs using include or includeAll
Last updated: July 14, 2025
As your Liquibase project grows, you'll likely split your database changes into multiple changelog files for better organization. To deploy all of your changes together, you need to connect your individual changelogs using a root changelog file.
This guide shows you how to use the include or includeAll tags to bring your changelog files together.
Before you begin
Make sure you've installed Liquibase and can run
liquibase
from your command line.Connect your database to Liquibase. You'll need to follow the integration guide for your specific database.
If you have an existing database, you'll also need to generate your changelog from your existing database.
Procedure
Know when to use include or include all.
Use
<include>
to manually list specific changelog files in the exact order you want them applied. For example, if you have a flat directory structure with no nested folders you might use several include tags for each file.com example db changelog changelog-root.yaml changelog-index.sql changelog-procedure.sql changelog-table.sql changelog-view.sql
Use
<includeAll>
to automatically include all changelog files from a directory, which Liquibase applies in alphabetical order. If you have a nested directory structure with folders nested inside folders you might use one includeAll tag to include every changelog under a particular directory. For example, if your implementation is set up like the example below, you would use include all on the folder changelog-indexes to include all the files under that folder, such as my-favorite-index.sql and that-other-index.sql.com example db changelog changelog-root.yaml changelog-indexes my-favorite-index.sql that-other-index.sql changelog-tables employees.sql customers.sql
Add include or includeAll tags to your root changelog
Example of using <include>
to reference individual files:
databaseChangeLog:
- include:
file: changelog-index.sql
relativeToChangelogFile: true
- include:
file: changelog-procedure.sql
relativeToChangelogFile: true
- include:
file: changelog-table.sql
relativeToChangelogFile: true
Example of using <includeAll>
to reference all files in a directory:
databaseChangeLog:
- includeAll:
path: changelog-indexes
relativeToChangelogFile: true
- includeAll:
path: changelog-tables
relativeToChangelogFile: true
You can also use both include and includeAll in one changelog.
databaseChangeLog:
- include:
file: changelog-setup.sql
relativeToChangelogFile: true
- includeAll:
path: changelog-features
relativeToChangelogFile: true