Phoenix 1.3-rc.1 umbrella project migrations

Hi there!

I created phoenix 1.3-rc.1 applications with –umbrella flag:

Then I generated JSON-controller with mix phx.gen.json command.
Then I created databases with mix ecto.create.
After that I tried to setup migrations from apps/PRJ_NAME_web/priv/repo/migrations.
But got only:

—————

** (Mix) Could not find migrations directory “PRJ_NAME/_build/dev/lib/PRJ_NAME/priv/repo/migrations”
for repo PRJ_NAME.Repo.

This may be because you are in a new project and the
migration directory has not been created yet. Creating an
empty directory at the path above will fix this error.

If you expected existing migrations to be found, please
make sure your repository has been properly configured
and the configured path exists.

——————
So I looked into PRJ_NAME/apps/PRJ_NAME/ and there was no priv/repo/migration directory. So I created it.
After that error is gone, but no migrations from PRJ_NAME_web are used.

——
mix ecto.migrate

17:07:37.395 [info] Already up
——

I believe that system takes migrations from PRJ_NAME/priv/repo/migrations directory, but not from the PRJ_NAME_web/priv/repo/migrations one.

Is it a BUG, or a FEATURE, or I’m doing it wrong? And how to deal with that?

--umbrella isn’t yet fully functional on the latest RC, see similar topic [1]. To avoid friction, I’d suggest using non-umbrella project or trying Phoenix master.

[1] New Phoenix 1.3 umbrella generators

Thanks for answer!

Isn’t this issue (https://github.com/phoenixframework/phoenix/issues/2139#issue-211500633) closed on the late of march?

Can I do something to fix it locally? After all, I believe it’s the issue of ecto.migration task, cause it’s searching migrations not in PRJ_NAME_web, but in PRJ_NAME.

Migrations should not be in the Web app, you will need to manually move them. Again, try Phoenix master for correct behaviour of generators :slight_smile:

It seems, as a temporary solution I can make soft link from PRJ_NAME_web/priv/repo to PRJ_NAME/priv/repo.

I have the same issue but I have not the PRJ_NAME_web directory so the previous fix wouldn’t work for me. Any other solution?

Have you tried 1.3-rc.2? Make sure you created your project with that archive and/or you use that version in mix.exs. Last te I checked it worked fine on rc.2

I finally found the way around it. As this issue occured in my CI server, I had to create and empty file inside priv/repo/migrations and commit this file so the directory is created on the CI server during build setup.

hello,

when is phoenix 1.3 finally going to be released

In a recent keynote @chrismccord said it’s basically done it just needs documentation. Expect a release very soon.

1 Like

ok. that means i can now go ahead and use it in production.