script

script

In the mix ecto.migrate docs there is a command line option --migrations-path. I tried it like this in my project

              mix ecto.migrate --migrations-path  "priv/repo/migrations". But it returns error

                 ** (Mix) Could not invoke task "ecto.migrate": 1 error found!
                     --migrations-path : Unknown option    

Am I doing something wrong?

Thanks

Showing Posts 1 to 10

NobbZ

NobbZ

What is your version of ecto_sql according to your mix.lock?

First mention of that option is in the docs of 3.1.3.

script

script OP

ecto_sql: 3.1.1

NobbZ

NobbZ

Then you probably need to unlock and update your version of ecto_sql

script

script OP

Thanks for pointing this out . It works . Now I am trying to run migrations from another umbrella app . like this:

                     mix ecto.migrate --migrations-path  "relative_path_to_the umbrella_app_migration_folder"

But it gives me this error:

    ** (Mix) Could not find migrations directory "apps/umbrella_app/priv/repo/migrations"
     for repo App.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.

I am following this thread:

I have single repo and migrations in two different umbrella apps.

https://forum.elixirforum.com/t/how-to-run-migrations-of-another-app-from-main-app/23444/10

Thanks.

NobbZ

NobbZ

Relative to where? And where in the filesystem do you run that command? Please use proper pathes here, not any obfuscations. Perhaps replace appnames with stubs, but make sure the regular umbrella structure is preserved when doing so, that we can understand what you are actually doing.

script

script OP

I run this command inside the umbrella app which contains the Repo. This is the relative path:

        mix ecto.migrate --migrations-path  "apps/al/priv/repo/migrations"

All the umbrella apps are inside the app directory. If i Provide the absolute path volumes/projects/apps/al/priv/repo/migrations it says already up. But no migrations will run.

I don’t have any config settings in the al app.

script

script OP

It seems to be working after dropping the database and creating again and then running the mix migrate command for the second app which doesn’t have a repo.

But it won’t work if i run the main app migrations first and then run the migrations from the other app(which don’t have repo). It returns already_up.

NobbZ

NobbZ

So you are running from inside an app, but specifiying the path relative to the umbrella project? That shouldn’t work…

Either specify a path relative to your current working dir or an absolute one.

script

script OP

Yes its working for absolute path but only if run the migrations from the second app first(which doesn’t have repo). But it gives me Already up console message if I run this after the main app migrations(which is what I need).

Phillipp

Phillipp

How are the migrations of both apps named? And can you successfully migrate the main app after the second app?

I guess the migrations table holds the name of the migration (either module or filename, I don’t know right now) and if the migrations in both apps are named the same way it thinks they are already migrated.

I haven’t worked with Elixir and a database in a long time, so this is just a wild guess.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New
jaybe78
Hello, I’m developing a online persistent chat system (what’s app) like using elixir/dynamodb/aws for a mobile app(flutter). The diffic...
New
Trolleger
What approach to take when sending live updates to “random” users Hi! I have a question, I have a little chat app, and when I create a DM...
New
widianto
I think I’ve found a small improvement I could contribute to <%= web_namespace %>.CoreComponents (installer/templates/phx_web/compo...
New

Other Trending Topics Top

garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
wintermeyer
There are three potential reasons for members of this forum to have a look at https://vutuv.de You are tired or annoyed of LinkedIn. Yo...
New
webofbits
Aludel - LLM Evaluation Workbench Aludel is an embeddable Phoenix LiveView dashboard for evaluating and comparing LLM prompts across mult...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews