Skip to content

Commit

Permalink
Ensure migrator module is loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseStimpson committed Apr 7, 2024
1 parent c463704 commit cb2a0df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/ecto_foundationdb/layer/query.ex
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ defmodule EctoFoundationDB.Layer.Query do
nil ->
raise Unsupported,
"""
FoundationDB Adapter supports either a where clause that constraints on the primary key
FoundationDB Adapter supports either a where clause that constrains on the primary key
or a where clause that constrains on a set of fields that is associated with an index.
"""

Expand Down
3 changes: 2 additions & 1 deletion lib/ecto_foundationdb/migrator.ex
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ defmodule EctoFoundationDB.Migrator do
def up(repo, tenant, options) do
migrator = Options.get(options, :migrator)
migrator = if is_nil(migrator), do: repo, else: migrator
limit = Options.get(options, :migration_step)
{:module, _} = Code.ensure_loaded(migrator)
migrations? = Kernel.function_exported?(migrator, :migrations, 0)

if migrations? do
limit = Options.get(options, :migration_step)
MigrationsPJ.transactional(repo, tenant, migrator, limit)
else
:ok
Expand Down

0 comments on commit cb2a0df

Please sign in to comment.