From cb2a0dffeb20f168d53fd41052a6462b5f6e106c Mon Sep 17 00:00:00 2001 From: Jesse Stimpson Date: Sun, 7 Apr 2024 11:26:16 -0400 Subject: [PATCH] Ensure migrator module is loaded --- lib/ecto_foundationdb/layer/query.ex | 2 +- lib/ecto_foundationdb/migrator.ex | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ecto_foundationdb/layer/query.ex b/lib/ecto_foundationdb/layer/query.ex index 80c1641..72ca10c 100644 --- a/lib/ecto_foundationdb/layer/query.ex +++ b/lib/ecto_foundationdb/layer/query.ex @@ -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. """ diff --git a/lib/ecto_foundationdb/migrator.ex b/lib/ecto_foundationdb/migrator.ex index d025315..8594edc 100644 --- a/lib/ecto_foundationdb/migrator.ex +++ b/lib/ecto_foundationdb/migrator.ex @@ -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