schemainspect icon indicating copy to clipboard operation
schemainspect copied to clipboard

Track extension enums

Open groner opened this issue 4 years ago • 6 comments

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.

groner avatar Jan 12 '21 21:01 groner

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?

groner avatar Jan 13 '21 17:01 groner

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?

djrobstep avatar Jan 13 '21 21:01 djrobstep

Adding extension_enums sounds good to me.

groner avatar Jan 14 '21 15:01 groner

@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.

groner avatar Jan 14 '21 17:01 groner

@djrobstep I'm hitting this issue in my database. Do you know the status of this PR?

jaredramirez avatar Apr 19 '22 16:04 jaredramirez

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.

sweatybridge avatar Aug 01 '22 05:08 sweatybridge