The project is to show possibility to use a shared connection poll for
several umbrella applications. The idea is to have an umbrella application
which holds a database connection (Repo
) and migrations for all projects.
The application which holds a database connections is apps\db
Migrations for all projects have to be stored in the apps\db
. The reason is that
migrations are connected to to the Repo
configuration. It is possible to configure
a custom migrations directory (instead of priv/repo/migrations
) but it is not
possible to configure more then one migrations
directory.
- mix deps.get
- MIX_ENV=test mix ecto.create
- MIX_ENV=test mix ecto.migrate
- mix test
The application:
- contains a database connections:
Db.Repo
- contains migrations for 2 applications:
apps/contacts
andapps/dealers
. To distinguish applications migration the are prefixed withcontacts
anddealers
forapps/contacts
andapps/dealers
respectively. - does not contain any implementation, including
Ecto
schemas.
The application:
- contains a sample
Contact
model. - contains a
Contact
Ecto
schema and tests. - it does not contain a database connection (
Ecto
repo). TheDb.Repo
is used. - the
Contact
migration is stored in theapps/db
application.
The application:
- contains a sample
Dealer
model. - contains a
Dealer
Ecto
schema and tests. - it does not contain a database connection (
Ecto
repo). TheDb.Repo
is used. - the
Dealer
migration is stored in theapps/db
application.
- Shared connection pool is used for all umbrella applications.
- All umbrella applications have to use the same database.
- All umbrella applications migrations are stored in the same directory which migth cause a mess.