rails-erd
rails-erd copied to clipboard
erd diff
Generate an ERD and allow it to be compared to a prior version of the graph, and color code new attributes, objects, and relationships
Without the added features of showing differences, is there a way to generate that wouldn't produce a different pdf if there are no changes substantive? When I generate more than once, git diff
says the binary files are different. I've set up git config to convert to text for the diff, but it'd be nice if the file wasn't "updated" when the only content change was the meta-date attribute (generation timestamp) and the title attribute (indicating where the file is stored).
In case someone finds this issue in search of a solution:
You can use --filetype=dot
to generate a .dot
file. This has the advantage of not containing any fast changing metadata like the pdf does. (The svg comes close, but it includes things about which version of graphviz was used to produce it)
However, the file is still not stable between runs, as it doesn't always seem to be generated in the same order.
To solve this, here is what I do on our CI to verify the generated diagram (in our repo) is up-to-date with the current model:
diff <(sort ci_generated_erd.dot) <(sort repo_erd.dot)
This seems to work and will fail if the model changes but the diagram wasn't updated.