elixir-ecto / ecto_sql

SQL-based adapters for Ecto and database migrations
https://hexdocs.pm/ecto_sql
Apache License 2.0
579 stars 312 forks source link

Fix: Use right dynamic repo during migrations #572

Closed Gigitsu closed 1 year ago

Gigitsu commented 1 year ago

Problem

Setting a dynamic repo (as explained here) has no effect when you run migrations because it overwrites your dynamic repo with the default one.

Proposal

Use repo.get_dynamic_repo() as the default value instead of repo

josevalim commented 1 year ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: