fix: don't reference polymorphic tables to belongs_to relationships

This commit is contained in:
Zach Daniel 2021-02-06 16:03:06 -05:00
parent 7d20669486
commit 3fa60c68ea

View file

@ -1090,6 +1090,7 @@ defmodule AshPostgres.MigrationGenerator do
all_resources
|> Enum.flat_map(&Ash.Resource.relationships/1)
|> Enum.filter(&(&1.destination == resource))
|> Enum.reject(&(&1.type == :belongs_to))
|> Enum.filter(& &1.context[:data_layer][:table])
|> Enum.map(fn relationship ->
resource