I have generated a new project in 1.3 with
mix phx.new application --umbrella and it would be nice when running
mix phx.gen.html or
mix phx.gen.json, have all the Domain’s stuffs & the web’s stuffs in their respective folders.
is it a forgotten feature? or is there another way?
There is an open issue for this in Phoenix’ issues tracker.
I’m guessing it’s this issue: https://github.com/phoenixframework/phoenix/issues/2139
Is this the reason why I’m seeing the following behavior?
- There is a
phx.gen.schemain the top level of the umbrella.
- When I run it, I see an error:
mix phx.gen.schema can only be run inside an application directory
- But in my
mix phx.gen.schemais not available. (None of the
phxtasks are, except
This happens immediately after
mix phx.new scratch --umbrella.
@marick new generators in umbrella are still under development, there’s an issue for it . To try them out, you need to go to
apps/scratch_web (or however your web app is called) and then run the new generators. Note, the generator will create schema and context files in the wrong place for now which is what  will fix.
Whats the work flow with the new phx.new --umbrella generator. When I’m in the ecto project I don’t seen anything to create a context or schema. I can create them in the web project, but then I have to move them to the ecto app and change the namespace.
Is that the work flow?
I believe it’s not released yet in a rc but you’d run the generators from the web app and they’d be aware of the context app (via e.g.
config :dummy_web, :generators, context_app: :dummy) and will create the files in the correct places. This would apply to all generators like
Good to hear. Saves me writing my own mix task. Thanks…