Thanks @LostKobrakai, that gave me the right idea. For anyone stumbling upon the same question and looking for an answer:
I’ve now setup the “accounts” library as described here Setting Up Testing for Library and use a config setting like this to set the repo for the “accounts” lib:
config :accounts, repo: Master.Repo
I then create the migrations this way:
MIX_ENV=test mix ecto.gen.migration xxx
And finally I’ve created a simple mix task that copies those migrations into the priv/repo/migrations folder of the “master” app, which is aliased to mix deps.get
and mix deps.update
, i.e.:
in mix.exs:
def project do
[
....
aliases: aliases()
]
end
defp aliases do
[
"deps.update": ["deps.update", "migrations.merge"],
"deps.get": ["deps.get", "migrations.merge"]
]
end