I have an app configured
config :my_app, ecto_repos: [MyApp.Repo, MyApp.LegacyRepo]
MyApp.Repo’s migrations are managed by Ecto. MyApp.LegacyRepo migrations are handled by Rails and error out on mix ecto.migrate
Is there a way to specify “I have two repos, but please ignore the second for migrations”?
Do you want to ignore them with mix ecto.migrate? Not sure how to do that, but in Ecto.Migrator.run/4 you need to pass a repo to run migrations for, so you can do it there, and it’s what usually gets suggested to be used with releases.
mix ecto.migrate
Ecto.Migrator.run/4
Oh, you can mix ecto.migrate -r Custom.Repo.
mix ecto.migrate -r Custom.Repo
Thanks! This solves 80% of my issue.
I was able to update test/test_helper.rb in a phoenix app from
Mix.Task.run "ecto.migrate", ["--quiet"]
to
Mix.Task.run "ecto.migrate", ["-r", "MyApp.Repo", "--quiet"]
to get tests runs to just migrate the Repo I wanted, and not the other