fix: sort references only after other same-table ops

This commit is contained in:
Zach Daniel 2021-06-08 17:41:35 -04:00
parent 3e50a0d119
commit da9d24c96f

View file

@ -1034,7 +1034,10 @@ defmodule AshPostgres.MigrationGenerator do
true
end
defp after?(%Operation.AlterAttribute{new_attribute: %{references: references}}, _)
defp after?(
%Operation.AlterAttribute{new_attribute: %{references: references}, table: table},
%{table: table}
)
when not is_nil(references),
do: true