Skip to content

Commit 9ffbda9

Browse files
authored
fix: Let MigrationGenerator use custom :migration_source (#688)
Without taking into account the repo’s config the schema migration versions lookup fails because of a non-existing table and the Mix task `ash.codegen` aborts.
1 parent 594028b commit 9ffbda9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/migration_generator/migration_generator.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ defmodule AshPostgres.MigrationGenerator do
540540
if tenant? do
541541
Ecto.Migrator.with_repo(repo, fn repo ->
542542
for prefix <- repo.all_tenants() do
543-
{repo, query, opts} = Ecto.Migration.SchemaMigration.versions(repo, [], prefix)
543+
{repo, query, opts} = Ecto.Migration.SchemaMigration.versions(repo, repo.config(), prefix)
544544

545545
repo.transaction(fn ->
546546
versions = repo.all(query, Keyword.put(opts, :timeout, :infinity))
@@ -574,7 +574,7 @@ defmodule AshPostgres.MigrationGenerator do
574574
end)
575575
else
576576
Ecto.Migrator.with_repo(repo, fn repo ->
577-
{repo, query, opts} = Ecto.Migration.SchemaMigration.versions(repo, [], nil)
577+
{repo, query, opts} = Ecto.Migration.SchemaMigration.versions(repo, repo.config(), nil)
578578

579579
repo.transaction(fn ->
580580
versions = repo.all(query, opts)

0 commit comments

Comments
 (0)