I’m using an Umbrella project for a Phoenix application, and I want to have one Ecto Repo and one PostgreSQL database shared by all apps.
However, I want each app to keep its own migrations inside its own priv/repo/migrations directory.
For example:
apps/
├── accounts/
│ └── priv/repo/migrations/
├── billing/
│ └── priv/repo/migrations/
├── commerce/
│ └── priv/repo/migrations/
└── tenants/
└── priv/repo/migrations/
All of these apps would use the same Hasteh.Repo and the same database.
What I’m looking for is a proper, built-in way to generate and manage this structure, rather than manually creating or moving migration files or maintaining custom scripts/tasks.
I have looked through the Phoenix, Ecto, and Mix documentation and several Umbrella examples, but I haven’t found a clear answer.
For example, is there an official generator or command that can create an app in an Umbrella project with:
- no separate Repo
- no separate database
- the shared Repo from the umbrella
- migrations stored under that app’s own
priv/repo/migrations - migrations automatically discovered and managed across all apps
I ended up writing my own Mix task to handle this, but I’d prefer not to maintain a custom solution if there is already an official or recommended approach.
Is this architecture supported by the Phoenix/Ecto generators? If so, what is the recommended command/workflow to create these apps?
For reference, I’ll include some of the code I currently use below to show how I implemented this approach.






















