Our project have multiple modules. We created databasechangelog file for each module. Liquibase was execute these files by alphabetical order not module dependency order. For example
Project
|
Module1
|
| - domain
| | - foo1
|
| - Changelogfile1.xml
Module2
|
| - domain
| | - foo2
|
| - Changelogfil2.xml
Module3
|
| - domain
| | - foo3
|
| - Changelogfile3.xml
My master.xml file look like below
...
<includeAll path="classpath*:${path}/x.x.x"/>
...
- Changelogfile1.xml contain foo1 table creation changeset information and its constraints definition changeset
...
<changeSet author="****" id="1">
<createTable tableName="foo1">
<column name="id" type="BIGINT">
...
<column name="foo2_id" type="INT">
...
</createTable>
</changeSet>
....
<addForeignKeyConstraint baseColumnNames="foo2_id" baseTableName="foo1"
constraintName="name" deferrable="false" initiallyDeferred="false"
referencedColumnNames="id" referencedTableName="foo2"/>
....
...
- Changelogfile2.xml contain foo2 table creation changeset information and its constraints definition changeset
...
<changeSet author="****" id="1">
<createTable tableName="foo2">
<column name="id" type="BIGINT">
...
...
...
</createTable>
</changeSet>
- Changelogfile3.xml contain foo3 table creation changeset information and its constraints definition changeset
- Here Module1 is depends on Module2. Table foo1 have OnetoOne relationship with foo2 table
Liquibase was execute change log file by below order
- Changelogfile1
- Changelogfile2
- Changelogfile3
I will expect liquibase should execute below order
- Changelogfile2
- Changelogfile1
- Changelogfile3
Is there any options to liquibase will execute database changelog file by its dependency order?