If I create a new Phoenix app with phx.new and answer “n” to the prompt Fetch and install dependencies? and then later run mix deps.get I get what seems like a strange ecto related warning after running mix deps.get and then mix create. The warning is:
warning: Ecto.Migrator.migrations/3 defined in application :ecto_sql is used by the current application but the current application does not depend on :ecto_sql. To fix this, you must do one of:
1. If :ecto_sql is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs
2. If :ecto_sql is a dependency, make sure it is listed under "def deps" in your mix.exs
3. In case you don't want to add a requirement to :ecto_sql, you may optionally skip this warning by adding [xref: [exclude: [Ecto.Migrator]]] to your "def project" in mix.exs
lib/phoenix_ecto/check_repo_status.ex:99: Phoenix.Ecto.CheckRepoStatus.migrations/3
Here’s the entire sequence:
% mix phx.new my_app
* creating my_app/config/config.exs
* creating my_app/config/dev.exs
* creating my_app/config/prod.exs
* creating my_app/config/runtime.exs
* creating my_app/config/test.exs
* creating my_app/lib/my_app/application.ex
* creating my_app/lib/my_app.ex
* creating my_app/lib/my_app_web/controllers/error_json.ex
* creating my_app/lib/my_app_web/endpoint.ex
* creating my_app/lib/my_app_web/router.ex
* creating my_app/lib/my_app_web/telemetry.ex
* creating my_app/lib/my_app_web.ex
* creating my_app/mix.exs
* creating my_app/README.md
* creating my_app/.formatter.exs
* creating my_app/.gitignore
* creating my_app/test/support/conn_case.ex
* creating my_app/test/test_helper.exs
* creating my_app/test/my_app_web/controllers/error_json_test.exs
* creating my_app/lib/my_app/repo.ex
* creating my_app/priv/repo/migrations/.formatter.exs
* creating my_app/priv/repo/seeds.exs
* creating my_app/test/support/data_case.ex
* creating my_app/lib/my_app_web/controllers/error_html.ex
* creating my_app/test/my_app_web/controllers/error_html_test.exs
* creating my_app/lib/my_app_web/components/core_components.ex
* creating my_app/lib/my_app_web/controllers/page_controller.ex
* creating my_app/lib/my_app_web/controllers/page_html.ex
* creating my_app/lib/my_app_web/controllers/page_html/home.html.heex
* creating my_app/test/my_app_web/controllers/page_controller_test.exs
* creating my_app/lib/my_app_web/components/layouts/root.html.heex
* creating my_app/lib/my_app_web/components/layouts/app.html.heex
* creating my_app/lib/my_app_web/components/layouts.ex
* creating my_app/priv/static/images/logo.svg
* creating my_app/lib/my_app/mailer.ex
* creating my_app/lib/my_app_web/gettext.ex
* creating my_app/priv/gettext/en/LC_MESSAGES/errors.po
* creating my_app/priv/gettext/errors.pot
* creating my_app/priv/static/robots.txt
* creating my_app/priv/static/favicon.ico
* creating my_app/assets/js/app.js
* creating my_app/assets/vendor/topbar.js
* creating my_app/assets/css/app.css
* creating my_app/assets/tailwind.config.js
* creating my_app/assets/vendor/heroicons/LICENSE.md
* creating my_app/assets/vendor/heroicons/UPGRADE.md
* extracting my_app/assets/vendor/heroicons/optimized
Fetch and install dependencies? [Yn] n
We are almost there! The following steps are missing:
$ cd my_app
$ mix deps.get
Then configure your database in config/dev.exs and run:
$ mix ecto.create
Start your Phoenix app with:
$ mix phx.server
You can also run your app inside IEx (Interactive Elixir) as:
$ iex -S mix phx.server
src % cd my_app
my_app % mix deps.get
Resolving Hex dependencies...
Resolution completed in 0.297s
New:
castore 1.0.2
cowboy 2.10.0
cowboy_telemetry 0.4.0
cowlib 2.12.1
db_connection 2.5.0
decimal 2.1.1
ecto 3.10.1
ecto_sql 3.10.1
esbuild 0.7.0
expo 0.4.1
file_system 0.2.10
finch 0.16.0
floki 0.34.2
gettext 0.22.1
hpax 0.1.2
jason 1.4.0
mime 2.0.3
mint 1.5.1
nimble_options 1.0.2
nimble_pool 1.0.0
phoenix 1.7.2
phoenix_ecto 4.4.1
phoenix_html 3.3.1
phoenix_live_dashboard 0.7.2
phoenix_live_reload 1.4.1
phoenix_live_view 0.18.18
phoenix_pubsub 2.1.1
phoenix_template 1.0.1
plug 1.14.2
plug_cowboy 2.6.1
plug_crypto 1.2.5
postgrex 0.17.1
ranch 1.8.0
swoosh 1.10.3
tailwind 0.2.0
telemetry 1.2.1
telemetry_metrics 0.6.1
telemetry_poller 1.0.0
websock 0.5.1
websock_adapter 0.5.1
* Getting phoenix (Hex package)
* Getting phoenix_ecto (Hex package)
* Getting ecto_sql (Hex package)
* Getting postgrex (Hex package)
* Getting phoenix_html (Hex package)
* Getting phoenix_live_reload (Hex package)
* Getting phoenix_live_view (Hex package)
* Getting floki (Hex package)
* Getting phoenix_live_dashboard (Hex package)
* Getting esbuild (Hex package)
* Getting tailwind (Hex package)
* Getting swoosh (Hex package)
* Getting finch (Hex package)
* Getting telemetry_metrics (Hex package)
* Getting telemetry_poller (Hex package)
* Getting gettext (Hex package)
* Getting jason (Hex package)
* Getting plug_cowboy (Hex package)
* Getting cowboy (Hex package)
* Getting cowboy_telemetry (Hex package)
* Getting plug (Hex package)
* Getting mime (Hex package)
* Getting plug_crypto (Hex package)
* Getting telemetry (Hex package)
* Getting cowlib (Hex package)
* Getting ranch (Hex package)
* Getting expo (Hex package)
* Getting castore (Hex package)
* Getting mint (Hex package)
* Getting nimble_options (Hex package)
* Getting nimble_pool (Hex package)
* Getting hpax (Hex package)
* Getting phoenix_template (Hex package)
* Getting file_system (Hex package)
* Getting db_connection (Hex package)
* Getting decimal (Hex package)
* Getting ecto (Hex package)
* Getting phoenix_pubsub (Hex package)
* Getting websock_adapter (Hex package)
* Getting websock (Hex package)
You have added/upgraded packages you could sponsor, run `mix hex.sponsor` to learn more
my_app % mix ecto.create
12:46:56.331 [info] Compiling file system watcher for Mac...
12:46:57.220 [info] Done.
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> decimal
Compiling 4 files (.ex)
Generated decimal app
==> mime
Compiling 1 file (.ex)
Generated mime app
==> nimble_options
Compiling 3 files (.ex)
Generated nimble_options app
===> Analyzing applications...
===> Compiling telemetry
==> telemetry_metrics
Compiling 7 files (.ex)
Generated telemetry_metrics app
===> Analyzing applications...
===> Compiling telemetry_poller
==> jason
Compiling 10 files (.ex)
Generated jason app
==> db_connection
Compiling 15 files (.ex)
Generated db_connection app
==> expo
Compiling 2 files (.erl)
Compiling 21 files (.ex)
Generated expo app
==> phoenix_pubsub
Compiling 11 files (.ex)
Generated phoenix_pubsub app
==> plug_crypto
Compiling 5 files (.ex)
Generated plug_crypto app
==> hpax
Compiling 4 files (.ex)
Generated hpax app
==> gettext
Compiling 17 files (.ex)
Generated gettext app
===> Analyzing applications...
===> Compiling ranch
==> ecto
Compiling 56 files (.ex)
Generated ecto app
==> plug
Compiling 1 file (.erl)
Compiling 40 files (.ex)
Generated plug app
==> phoenix_html
Compiling 9 files (.ex)
Generated phoenix_html app
==> phoenix_template
Compiling 4 files (.ex)
Generated phoenix_template app
==> postgrex
Compiling 68 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 25 files (.ex)
Generated ecto_sql app
==> nimble_pool
Compiling 2 files (.ex)
Generated nimble_pool app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> esbuild
Compiling 3 files (.ex)
Generated esbuild app
==> tailwind
Compiling 3 files (.ex)
Generated tailwind app
==> mint
Compiling 1 file (.erl)
Compiling 19 files (.ex)
Generated mint app
==> finch
Compiling 13 files (.ex)
Generated finch app
==> websock
Compiling 1 file (.ex)
Generated websock app
===> Analyzing applications...
===> Compiling cowlib
===> Analyzing applications...
===> Compiling cowboy
===> Analyzing applications...
===> Compiling cowboy_telemetry
==> plug_cowboy
Compiling 5 files (.ex)
Generated plug_cowboy app
==> swoosh
Compiling 42 files (.ex)
Generated swoosh app
==> websock_adapter
Compiling 2 files (.ex)
Generated websock_adapter app
==> phoenix
Compiling 71 files (.ex)
Generated phoenix app
==> phoenix_live_reload
Compiling 4 files (.ex)
Generated phoenix_live_reload app
==> phoenix_live_view
Compiling 35 files (.ex)
Generated phoenix_live_view app
==> phoenix_live_dashboard
Compiling 40 files (.ex)
Generated phoenix_live_dashboard app
==> phoenix_ecto
Compiling 7 files (.ex)
warning: Ecto.Migrator.migrations/3 defined in application :ecto_sql is used by the current application but the current application does not depend on :ecto_sql. To fix this, you must do one of:
1. If :ecto_sql is part of Erlang/Elixir, you must include it under :extra_applications inside "def application" in your mix.exs
2. If :ecto_sql is a dependency, make sure it is listed under "def deps" in your mix.exs
3. In case you don't want to add a requirement to :ecto_sql, you may optionally skip this warning by adding [xref: [exclude: [Ecto.Migrator]]] to your "def project" in mix.exs
lib/phoenix_ecto/check_repo_status.ex:99: Phoenix.Ecto.CheckRepoStatus.migrations/3
Generated phoenix_ecto app
==> my_app
Compiling 15 files (.ex)
Generated my_app app
The database for MyApp.Repo has been created