schemainspect
schemainspect copied to clipboard
Track extension enums
This PR fixes a crash when inspecting tables or types referencing enums that belong to an extension.
I haven't figured out how to make the postgresql extension available for the test in circleci. It doesn't seem like there's a way to add files to the auxiliary containers, so I guess we need to build a new image with it included.
This is kind of a breaking change, because existing versions of migra won't know to exclude enums with is_extension set. This could be avoided by exposing extension enums separately.
@djrobstep What are your thoughts on this?
Yep I think to work around this, we ought not to have enums from extensions included in the enum list. Perhaps a good solution is a separate dict of extension_enums
.
That way it won't cause breaking changes. But then during dependency tracking that dict can also be looked in for dependencies. What do you think?
Adding extension_enums
sounds good to me.
@djrobstep I wasn't sure if extension_enums
should be used in PostgreSQL.dependency_order
and I couldn't find any uses of it outside of the tests.
@djrobstep I'm hitting this issue in my database. Do you know the status of this PR?
Hi @djrobstep, I'm hoping to get a status update on this PR as well.
For your context, we recently added migra as an experimental diff tool to Supabase CLI and encountered the same issue with enum. As a temporary workaround, we are monkey patching this library here.