fuelen / ecto_erd

A mix task for generating Entity Relationship Diagram from Ecto schemas available in your project.
Apache License 2.0
215 stars 15 forks source link

Ecto.Enum types not supported #14

Closed jaimeiniesta closed 2 years ago

jaimeiniesta commented 2 years ago

Some of our models have fields of Ecto.Enum type.

When I generate a graph for them, the description for the type is too long, which leads to a very wide box for the entity:

ecto_erd_enum

Instead, I would expect a shorter version of the enumerated type, including just the list of allowed values.

fuelen commented 2 years ago

Hi @jaimeiniesta Thank you for the report. yes, Ecto.Enum should be supported https://github.com/fuelen/ecto_erd/blob/81794cb9e1869aeb314bc806f00b2ab61fb63ff9/lib/ecto/erd/dot.ex#L141-L143 But it seems like internal representation of the type has been changed in this commit https://github.com/elixir-ecto/ecto/commit/790616281a787a9f5715476c62d811b8b64beedd#diff-025069044568b480ef6f86f025cb46a7064695e6df1e7008ede689e09a9c7836R97