-
Notifications
You must be signed in to change notification settings - Fork 251
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
Use mermaid for migrations graph #1186
base: main
Are you sure you want to change the base?
Conversation
The migrations ASCII art previously used was somewhat hard to read and much harder to maintain over time. Mermaid markdown provides a very easy way to add new nodes to the graph, and the result is far more visually parseable. Mermaid can be rendered on GitHub or via a local extension such as in VS Code. I've added an extension recommendation for VS Code as part of this change.
Other ideas I have for improving on this is to make it more clear which nodes I need to derive on when I change a particular database entity. So maybe elsewhere in the new markdown file, a list of each db entity (e.g. table, view, index) with a sub-list of each migration that impacted it, and a description of what the migration did to it. That way if I need to change an entity, I can quickly find the list of dependencies I'll need. Then by referring to the graph, I can weed out the redundant dependencies. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1186 +/- ##
==========================================
- Coverage 65.03% 65.02% -0.01%
==========================================
Files 114 114
Lines 11108 11108
==========================================
- Hits 7224 7223 -1
- Misses 3884 3885 +1 ☔ View full report in Codecov by Sentry. |
Can |
@nuttycom: Copilot says no.
(1) GitHub - mermaid-js/mermaid: Generation of diagrams like flowcharts or .... https://github.com/mermaid-js/mermaid. |
Here's the mermaid-js feature request: mermaidjs/mermaid-live-editor#36 |
I'd rather see only the .md file. But given @nuttycom prefers the ascii approach, what if I modify the PR to retain the ASCII graphic and simply add the .md file? That way folks who prefer to refer the image can do so, at the cost of maintaining two sources of truth, although the .md file is much easier to maintain than the .rs comments, so it doesn't add a lot of effort to have to add maintenance of the .md file. |
The migrations ASCII art previously used was somewhat hard to read and much harder to maintain over time. Mermaid markdown provides a very easy way to add new nodes to the graph, and the result is far more visually parseable.
Mermaid can be rendered on GitHub or via a local extension such as in VS Code. I've added an extension recommendation for VS Code as part of this change.
Here is what it looks like in VS Code:
And right here in the PR, github will render the graphic with the click of a button on the introduced file.