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

Conversation

Schultzer
Copy link
Contributor

This PR allows running mix ecto.setup from the root of an umbrella project.

This PR allows running `mix ecto.setup` from the root of an umbrella project.
@@ -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. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants