Use migration files from an dependency app to generate another database

Hello there, is it possible to use migration files from another app dependency (in my umbrella project) to create and populate the database from my current app?

Basically I have some tables that are common to several apps databases in my umbrella. But each app needs to have it’s own database.

For now, each app have the same migration file copied for these tables (code duplication!) since they have the same structure.

So, my question is if there is some way to basically create a “generic” ecto project with these common migration files and use it to create the database without needing to copy then everywhere.

The usual way to do this, is to add a mix-task to that common library which initialises its subsection of the database by creating appropriate migrations.

Thanks @NobbZ, is there some documentation or some example on how to do it somewhere?

I saw that link but can’t figure out how to achieve what I want.