TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Visualize Your Rails App to ER Diagram Automatically

104 pointsby huyover 6 years ago

13 comments

jaggederestover 6 years ago
There&#x27;s also <a href="https:&#x2F;&#x2F;github.com&#x2F;voormedia&#x2F;rails-erd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;voormedia&#x2F;rails-erd</a> and my favorite <a href="https:&#x2F;&#x2F;github.com&#x2F;amatsuda&#x2F;erd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;amatsuda&#x2F;erd</a> which is fully interactive (can write migrations based on changes from the UI)
评论 #18327456 未加载
SOLAR_FIELDSover 6 years ago
I recently discovered schemaspy and while it took a bit of working knowledge of java (need to execute a jar file from the command line) to get it working, it’s absolutely fantastic and one of the most sophisticated tools for dealing with ERDs at the DB level. Plus it’s open source! The only things I see that are possible improvements with this product are the fact that you don’t need to bootstrap a local database to generate this and it’s probably faster and easier to generate. I had a reasonably complex schema (200 ish tables with relationships) and schemaspy took about 3 minutes to generate the output. Once you do generate it though, it’s just a bunch of html and SVG in a folder so you don’t have to regenerate it until your scheme is updated.
Exumaover 6 years ago
I appreciate the side project but it&#x27;s very hard to read. It doesnt really show much anything either. I much prefer <a href="https:&#x2F;&#x2F;github.com&#x2F;voormedia&#x2F;rails-erd" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;voormedia&#x2F;rails-erd</a><p>Example: <a href="https:&#x2F;&#x2F;camo.githubusercontent.com&#x2F;f705fefa37f808758adbfa8e53d7ba2d8d9a59d7&#x2F;68747470733a2f2f766f6f726d656469612e6769746875622e696f2f7261696c732d6572642f696d616765732f656e746974792d72656c6174696f6e736869702d6469616772616d2e706e67" rel="nofollow">https:&#x2F;&#x2F;camo.githubusercontent.com&#x2F;f705fefa37f808758adbfa8e5...</a>
评论 #18325528 未加载
tabtabover 6 years ago
In a more general sense, I don&#x27;t understand why we can&#x27;t define field attributes in ONE spot and have most of the application software automatically just use that info rather than reinvent it in code?<p>Things were moving that way in the 80&#x27;s it appeared, then OOP came along and overzealous practitioners declared RDBMS and tables as an official evil. Sure, different screens or reports may need different subsets of such fields, but filters can be built to sort or filter different &quot;views&quot; as needed per usage point. (OOP is good for some things, but not others.)<p>I&#x27;m tired of retyping or mass-replicating the field wheel. Let&#x27;s return to table-oriented programming and data dictionaries. It&#x27;s a D.R.Y. sin. Code is NOT the best place to store most field info. (RDBMS can also store navigation, screen, and menu info, but one thing at a time. 90% of typical CRUD could be done in a declarative sense.)<p>You are welcome to disagree; I encourage spirited debate.
评论 #18332294 未加载
sam0x17over 6 years ago
It doesn&#x27;t work. When I import my schema.rb file it takes issue with basically every line saying things like unexpected token etc. I&#x27;m using the &quot;upload schema.rb&quot; file button, but it&#x27;s like it&#x27;s trying to parse it as SQL.
评论 #18325238 未加载
评论 #18371824 未加载
badtupleover 6 years ago
This is really nice!<p>To those trying it out: if the diagram seems inaccurate, try dragging tables around.<p>I uploaded a very simple schema, but seemingly unrelated tables looked connected. Turns out it&#x27;s 100% accurate, but relationships can run behind other tables and make it look like things are connected that aren&#x27;t. Detangling is easy with a few drags&#x2F;drops and you get a really nice diagram out of it.
评论 #18333173 未加载
评论 #18325510 未加载
phelmigover 6 years ago
This is super useful, for Django you can use the Django-Extensions [1] to generate a similar, static representation.<p>[1] <a href="https:&#x2F;&#x2F;django-extensions.readthedocs.io&#x2F;en&#x2F;latest&#x2F;graph_models.html" rel="nofollow">https:&#x2F;&#x2F;django-extensions.readthedocs.io&#x2F;en&#x2F;latest&#x2F;graph_mod...</a>
Falling3over 6 years ago
This looks really great and seems to handle some things better than rails-erd (multiple relationships between the same 2 models).<p>Are there any plans to make the interactive version exportable or embeddable? I&#x27;m working on an application right now that this UX would be perfect for.
fareeshover 6 years ago
Looks great. I used to use rails-erd when I needed a diagram. This seems a lot better
colinbartlettover 6 years ago
Looks neat! I was unable to use it on my more recent Rails projects which all have schema version that contain underscores. Example: `ActiveRecord::Schema.define(version: 2018_10_23_121007)`.
评论 #18326309 未加载
iziettoover 6 years ago
I&#x27;ve got an error, lambda functions inside schema aren&#x27;t recognized; f.e.:<p><pre><code> t.datetime &quot;created_at&quot;, default: -&gt; { &quot;now()&quot; }</code></pre>
评论 #18326158 未加载
emehrkayover 6 years ago
This is really cool. Are there any examples on how to create svg like that or is this project open source somewhere?
评论 #18328314 未加载
mega-tuxover 6 years ago
works ok but I had to remove &quot;on_delete: :cascade&quot; on add_foreign_key lines.