/ dbdiagram

How to Visualize Your Rails ERD Diagram Instantly

How to Visualize Your Rails ERD Diagram Instantly

Rails comes with a schema.rb file that contains a clear definition of your database tables and how they're linked together. But what if you want to generate an entity-relationship diagram (ERD) of your Rails app to quickly get a sense of how they look?

Since we launched dbdiagram.io, a free and simple tool to draw entity relationship diagram 4 weeks back, we've been getting tons of feedback. Among those, a lot of people are asking if we support integrations with Rails, Django, or Laravel.

So today I'm excited to share that we've fulfilled one of the first steps: we now support Rails! If you are a Rails developer, you can quickly generate a database relationship diagram (or ERD diagram) from your schema.rb, in just 3 simple steps:

  1. Open dbdiagram.io
  2. Click Import → From Rails (schema.rb)
  3. Paste (or upload) your schema.rb
  4. Profit!

Visualize your Rails ERD diagram using dbdiagram.io

Some cool features that the tool has:

  • Auto recognize your Rails relationship: It reads both explicit and implicit foreign key definitions (and convention), then translates them to the correct relationships. Explicit definitions like add_foreign_key() or t.references 'user' are recognized; implicit (convention) definition like t.integer user_id are also recognized!
  • You can generate a beautiful PDF file afterwards.
  • It's completely free!

If you want to give it a try, go to dbdiagram.io and upload your schema.rb to see how your rails erd diagram look.

Huy Nguyen

Huy Nguyen

Original creator and cofounder of Holistics, a data platform for tech companies. Holistics’ customers are tech startups like Grab, Traveloka, ShopBack, 99co, Tech In Asia and alike.

Read More

From SQL Queries To Beautiful Charts

Connect to your database and build beautiful charts with Holistics BI

Learn More
Grab Logo

"Holistics is the solution to the increasingly many and complex data requests from the operational teams"


Tang Yee Jie - Senior Data Analyst, Grab

Tang Yee Jie

Senior Data Analyst, Grab