fix: don't try and match reference schema to table schema

This commit is contained in:
Zach Daniel 2022-05-18 13:47:08 -04:00
parent 75bee65b29
commit 5a61409e56

View file

@ -1057,10 +1057,10 @@ defmodule AshPostgres.MigrationGenerator do
defp after?( defp after?(
%Operation.AddAttribute{ %Operation.AddAttribute{
attribute: %{ attribute: %{
references: %{table: table, destination_field: name, schema: schema} references: %{table: table, destination_field: name}
} }
}, },
%Operation.AddAttribute{table: table, schema: schema, attribute: %{source: name}} %Operation.AddAttribute{table: table, attribute: %{source: name}}
), ),
do: true do: true
@ -1110,10 +1110,10 @@ defmodule AshPostgres.MigrationGenerator do
do: true do: true
defp after?( defp after?(
%Operation.RemoveAttribute{attribute: %{source: source}, table: table, schema: schema}, %Operation.RemoveAttribute{attribute: %{source: source}, table: table},
%Operation.AlterAttribute{ %Operation.AlterAttribute{
old_attribute: %{ old_attribute: %{
references: %{table: table, schema: schema, destination_field: source} references: %{table: table, destination_field: source}
} }
} }
), ),
@ -1122,10 +1122,10 @@ defmodule AshPostgres.MigrationGenerator do
defp after?( defp after?(
%Operation.AlterAttribute{ %Operation.AlterAttribute{
new_attribute: %{ new_attribute: %{
references: %{table: table, schema: schema, destination_field: name} references: %{table: table, destination_field: name}
} }
}, },
%Operation.AddAttribute{schema: schema, table: table, attribute: %{source: name}} %Operation.AddAttribute{table: table, attribute: %{source: name}}
), ),
do: true do: true