Umbrella application error when trying to create a migration with ecto elixir
Asked Answered
C

1

5

I'm trying to create a migration using the command mix ecto.gen.migration <migration_name> and I'm getting the error:

Cannot run task "ecto.gen.migration" from umbrella application

Why I'm getting this error?

Coot answered 12/3, 2019 at 20:10 Comment(1)
My guess is you are trying to run that command from the umbrella's top level. Go into the directory of one of your applications ($UMBRELLA/apps/foo) and you should be able to run it there.Breeching
O
6

For umbrella apps you need to explicitly run the migrations inside the application where the repo lives. This is because in umbrella applications, you can have multiple applications, all with multiple repos, so the generator would not know which application to run it for, so you have to run it within that application.

cd apps/my_app_name && mix ecto.gen.migration create_users
Outpouring answered 13/3, 2019 at 0:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.