✅ Short Answer
**<include>**
lets you include one specific changelog file into another**<includeAll>**
lets you include all changelogs from a folder, automatically
This helps you modularize and organize your migrations across many files..
🔎 Detailed Explanation
🔹 include
Used to include a single specific file inside another changelog:
<include file="tables/users.xml" relativeToChangelogFile="true"/>
✅ Use this when you want explicit control over the load order
✅ Often used in a master changelog that lists all migration files
🔹 includeAll
Used to include all changelogs in a directory, in sorted order:
<includeAll path="tables/" relativeToChangelogFile="true"/>
✅ Includes all changelogs from the tables/
directory
✅ Files are loaded in alphabetical order
✅ Convenient when managing many small changelogs
🧠 Use Cases
Use Case | Use include or includeAll |
---|---|
Want full control over migration order | ✅ include |
Want to auto-include all scripts in a folder | ✅ includeAll |
Team adds changelogs frequently in parallel | ✅ includeAll for flexibility |
Production migrations in strict order | ✅ include for safety |
⚠️ Caution with includeAll
- ❗ Ordering is by file name, so use naming like
V001_init.xml
,V002_add_index.xml
- ❗ May re-include deleted files if you don’t clean up unused changelogs
📌 Key Takeaways
✅ Use <include>
to add one changelog file, with manual order control
✅ Use <includeAll>
to add all changelogs from a directory, automatically sorted
✅ Modularization improves maintainability, especially in large projects