Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 434
Hatsumi Avatar asked Mar 12 '19 20:03

Hatsumi


1 Answers

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
like image 195
Harrison Lucas Avatar answered Nov 04 '22 19:11

Harrison Lucas