0

Our spring boot application uses a databaseChangeLog as xml with multiple <includes ... for other changelogs:

<databaseChangeLog ...>
  <include file="db.changelog-a.xml" context="prod" />
  <include file="db.changelog-b.xml" context="prod" />
  <include file="db.changelog-c.xml" context="test" />
</databaseChangeLog>

The changelogs db.changelog-a.xml and db.changelog-b.xml contain SQL scripts with thousands of insertstatements.

When launching the application in a test environment/context these two changelogs are not executed (which is correct).

However, it seems liquibase still reads these files while parsing the xml file. This takes up to several minutes and consumes > 90% of the startup-time.

I found out, when using <includeAll ..> with a custom filter this issue does not occurr and liquibase does not seem to read the filtered files. The filter, however, has no access to the current context so it would be tricky to write a filter that respects the current environment without hacks.

Is there any other way how to prevent liquibase reading certain changelogs in certain contexts?

htmoia
  • 429
  • 4
  • 9

0 Answers0