Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mix ecto.setup from the umbrella root. #5692

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion installer/templates/phx_umbrella/apps/app_name/mix.exs
Expand Up @@ -52,7 +52,7 @@ defmodule <%= @app_module %>.MixProject do
defp aliases do
[
setup: ["deps.get"<%= if @ecto do %>, "ecto.setup"<% end %>]<%= if @ecto do %>,
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"],
"ecto.setup": ["ecto.create", "ecto.migrate", "run #{__DIR__}/priv/repo/seeds.exs"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we need to add this entry, it means it is running on several apps. We probably need a different solution. Perhaps we should use an alias with Code.require_file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is why I pushed this PR; regardless of how many apps I have with different databases, when I invoke mix ecto.setup in the root, I want all my apps to run it. If I cared about only a specific app, I would follow the current behaviour, which is to cd into my app and invoke mix ecto.setup.

With that in mind, I'm unsure what the issue is. Can you please provide some more context? Maybe I'm missing something obvious.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood. This looks good to me then. :)

"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"]<% end %>
]
Expand Down