bugfix: ensure repo is compiled (#80)

This commit is contained in:
kernel-io 2021-12-22 08:19:33 +13:00 committed by GitHub
parent 50b397d7dd
commit 4a1f1880ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1517,6 +1517,8 @@ defmodule AshPostgres.MigrationGenerator do
defp pad(i), do: to_string(i)
def get_snapshots(resource, all_resources) do
Code.ensure_compiled!(AshPostgres.repo(resource))
if AshPostgres.polymorphic?(resource) do
all_resources
|> Enum.flat_map(&Ash.Resource.Info.relationships/1)