-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the migration_path
and snapshot_path
to be configured per repo.
#426
Comments
AFAIK this is configurable per repo. I will look into it when I'm back at a computer though. |
@jimsynz is there a reproduction or a specific example of the issue/case where we weren't honoring this option? Looking at the code: def derive_migrations_path(repo) do
config = repo.config()
priv = config[:priv] || "priv/#{repo |> Module.split() |> List.last() |> Macro.underscore()}"
app = Keyword.fetch!(config, :otp_app)
Application.app_dir(app, Path.join(priv, "migrations"))
...
def derive_tenant_migrations_path(repo) do
config = repo.config()
priv = config[:priv] || "priv/#{repo |> Module.split() |> List.last() |> Macro.underscore()}"
app = Keyword.fetch!(config, :otp_app)
Application.app_dir(app, Path.join(priv, "tenant_migrations"))
...
So it's clear we're at least attempting to honor the repo's |
nvm, we don't use it for snapshots. |
But we do allow the opts[:migrations_path] || repo.config()[:migrations_path] || derive_migrations_path(repo)
end
def tenant_migrations_path(opts, repo) do
opts[:migrations_path] || repo.config()[:tenant_migrations_path] ||
derive_tenant_migrations_path(repo)
end |
…itly configurable closes ash-project#426
An APS client with a number of repos in their app recently asked if it's possible to have ash_postgres honour Ecto's
:priv
config value. I think we should both honour that value, but also allow configuration of the migration path and snapshot path on a per-repo basis.The text was updated successfully, but these errors were encountered: