rails-erd icon indicating copy to clipboard operation
rails-erd copied to clipboard

erd diff

Open kerrizor opened this issue 6 years ago • 2 comments

Generate an ERD and allow it to be compared to a prior version of the graph, and color code new attributes, objects, and relationships

kerrizor avatar Oct 16 '17 19:10 kerrizor

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

timirwin avatar Feb 05 '21 17:02 timirwin

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.

Zinggi avatar Feb 23 '22 12:02 Zinggi