# Liquibase alter sorting

**URL:** <https://forum.liquibase.org/t/liquibase-alter-sorting/5088>\
**Category:** General Discussion\
**Created:** [February 18, 2021, 3:29pm UTC](https://forum.liquibase.org/t/liquibase-alter-sorting/5088 "2021-02-18T15:29:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![joeljoejoseph](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@joeljoejoseph](https://forum.liquibase.org/u/joeljoejoseph)\
**Post date:** [February 18, 2021, 3:29pm UTC](https://forum.liquibase.org/t/liquibase-alter-sorting/5088/1 "2021-02-18T15:29:08Z")

</div>

Hi All,

We have a need of using include all keyword in liquibase due to avoiding the conflicts in the liquibase. But ordering is not proper. Any way to resolve the issue.

we required to run the Alter version as:  
PR\_52\_5.2.0.0.8  
PR\_52\_5.2.0.0.9  
PR\_52\_5.2.0.0.10  
PR\_52\_5.2.0.0.11  
PR\_52\_5.2.0.0.20  
PR\_52\_5.2.0.0.21

Now executing:  
PR\_52\_5.2.0.0.10  
PR\_52\_5.2.0.0.11  
PR\_52\_5.2.0.0.20  
PR\_52\_5.2.0.0.21  
PR\_52\_5.2.0.0.8  
PR\_52\_5.2.0.0.9

---

<div class="post-metadata">

**Author:** ![mouse\_8b](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mouse_8b/32/335_2.png) [@mouse\_8b](https://forum.liquibase.org/u/mouse_8b)\
**Post date:** [February 19, 2021, 4:32pm UTC](https://forum.liquibase.org/t/liquibase-alter-sorting/5088/2 "2021-02-19T16:32:24Z")

</div>

The `includeAll` keyword reads the changelogs alphabetically. This is likely a function of the underlying operating system and not liquibase itself. You should number your changelogs with leading zeros (eg 5.2.0.0.08) if you want includeAll to sort them properly. Alternatively, you can use `include` to manually specify the execution order.

---

<div class="post-metadata">

**Author:** ![bran](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/bran/32/311_2.png) [@bran](https://forum.liquibase.org/u/bran)\
**Post date:** [February 22, 2021, 1:25pm UTC](https://forum.liquibase.org/t/liquibase-alter-sorting/5088/3 "2021-02-22T13:25:39Z")

</div>

Use include file within the dependent changelog before the changeset to force liquibase to execute the dependencies first.

Master.changelog.xml  
Include all path …

0001.xml  
Include file 0002.xml  
Changeset 1

0002.xml  
Changeset 2
