Skip to content

Commit

Permalink
Fix tests (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Aug 27, 2024
1 parent d37bd8f commit 6dadb5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/support/test_repo.exs
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,21 @@ defmodule EctoSQL.TestAdapter do

def execute(_, _, {:nocache, {:all, query}}, _, opts) do
%{from: %{source: {"schema_migrations", _}}} = query
:schema_migrations = opts[:ecto_query]
:schema_migration = opts[:ecto_query]
versions = MigrationsAgent.get()
{length(versions), Enum.map(versions, &[elem(&1, 0)])}
end

def execute(_, _, {:nocache, {:delete_all, query}}, params, opts) do
%{from: %{source: {"schema_migrations", _}}} = query
[version] = params
:schema_migrations = opts[:ecto_query]
:schema_migration = opts[:ecto_query]
MigrationsAgent.down(version, opts)
{1, nil}
end

def insert(_, %{source: "schema_migrations"}, val, _, _, opts) do
:schema_migrations = opts[:ecto_query]
:schema_migration = opts[:ecto_query]
version = Keyword.fetch!(val, :version)
MigrationsAgent.up(version, opts)
{:ok, []}
Expand Down

0 comments on commit 6dadb5e

Please sign in to comment.