fix: properly parse previous version from migration generation

This commit is contained in:
Zach Daniel 2024-05-12 12:50:13 -04:00
parent 9e2c01693f
commit 2421e6fc2c

View file

@ -254,7 +254,7 @@ defmodule AshPostgres.MigrationGenerator do
{ext_name, _version, up_fn, _down_fn} when is_function(up_fn, 1) ->
current_version =
Enum.find_value(extensions_snapshot[:installed] || [], 0, fn name ->
with ["", "v" <> version] <- String.split(name, to_string(ext_name)),
with ["", "_v" <> version] <- String.split(name, to_string(ext_name)),
{integer, ""} <- Integer.parse(version) do
integer
else