Skip to content

Commit

Permalink
fix: use passed in version of postgres when modifying existing repo
Browse files Browse the repository at this point in the history
  • Loading branch information
zachdaniel committed Dec 26, 2024
1 parent a3edddd commit 80ccc19
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/mix/tasks/ash_postgres.install.ex
Original file line number Diff line number Diff line change
Expand Up @@ -536,18 +536,16 @@ if Code.ensure_loaded?(Igniter) do
end
end

defp configure_min_pg_version_function(zipper, _repo, _version, _opts) do
defp configure_min_pg_version_function(zipper, _repo, version, _opts) do
case Igniter.Code.Function.move_to_def(zipper, :min_pg_version, 0) do
{:ok, zipper} ->
{:ok, zipper}

_ ->
min_pg_version = get_min_pg_version()

{:ok,
Igniter.Code.Common.add_code(zipper, """
def min_pg_version do
%Version{major: #{min_pg_version.major}, minor: #{min_pg_version.minor}, patch: #{min_pg_version.patch}}
%Version{major: #{version.major}, minor: #{version.minor}, patch: #{version.patch}}
end
""")}
end
Expand Down

0 comments on commit 80ccc19

Please sign in to comment.