How to use multiple liquibase files in a module?

I am currently developing an openmrs module. Like in every module i have a liquibase file, where the data i want to add to the database is specified. Here’s my question:

In the openmrs-core there are several liquibase files. There is a great seperation into liquibase-core-data.xml (setup the database content) and liquibase-schema-only.xml (set up the database schema).

In my module i want to do the same approach for setting up my tables, so the module setup works similar to openmrs-core.

But only files named exact “liquibase.xml” are executed.

How can I make it work? Or is this separation in modules complete nonsense? Is it better way to do it in a single file?

Thank you for your support!

I have not seen anyone try to do this. In practice modules rarely create many database tables, so this would be rarely worthwhile. (Also there is sometimes benefit for someone else debugging your module to look at just one file and see the liquibase changesets in order.)

The limitation is in openmrs-core code, around here:

So, it would require a change to openmrs-core to support this (PRs welcome!) but my personal recommendation would be to just go with the single liquibase.xml file.

Thank you for your response! I think i will stick to the single file solution. Thanks again :smile: