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

How to exclude some schemas? #47

Closed drselump14 closed 1 year ago

drselump14 commented 1 year ago

Hi, Can some schema be excluded from generated ERD? There are some schemas that don't have tables, and I don't want to include this schema to generate ERD

drselump14 commented 1 year ago

Just found the answer from elixirforum here (https://elixirforum.com/t/ecto-erd-entity-relationship-diagram-generator-for-ecto/41994/11)

This config works for my use case.

[
  map_node: fn
    %{source: "schema_migrations"} -> nil #disable ERD generation for table schema_migrations
    %{source: "oban_jobs"} -> nil #disable ERD generation for table oban_jobs
    %{schema_module: MyApp.Accounts.DesignerAdminRegistrationForm} -> nil
    #disable ERD generation for DesignerAdminRegistrationForm schema (table-less schema)
    node -> node
  end
]