Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Add blurb for how to tie ecto_erd into migrations #56

Open
kieraneglin opened this issue May 22, 2024 · 2 comments
Open

[Suggestion] Add blurb for how to tie ecto_erd into migrations #56

kieraneglin opened this issue May 22, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@kieraneglin
Copy link

kieraneglin commented May 22, 2024

I want my ERD file to always be up-to-date and don't have to have to remember to run it each time. For that, I've added two entries to the aliases method in my mix.exs:

"ecto.migrate": [
  "ecto.migrate",
  "ecto.gen.erd --output-path=priv/repo/ecto_erd.dot",
  "cmd dot -Tpng priv/repo/ecto_erd.dot -o priv/repo/erd.png"
],
"ecto.rollback": [
  "ecto.rollback",
  "ecto.gen.erd --output-path=priv/repo/ecto_erd.dot",
  "cmd dot -Tpng priv/repo/ecto_erd.dot -o priv/repo/erd.png"
]

These regenerate the ERD every time I migrate or rollback the database. I imagine I'm not the only one who benefits from this so I thought I'd mention in case you wanted to add something like this to the README!

@fuelen
Copy link
Owner

fuelen commented May 22, 2024

PR is welcome!

@fuelen
Copy link
Owner

fuelen commented May 22, 2024

It would be great if you add this both to README and to moduledoc of Mix.Tasks.Ecto.Gen.Erd

@fuelen fuelen added the documentation Improvements or additions to documentation label May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants