SchemaRD
Overview
SchemaRD is a Entity Relationship Diagram Viewer for schema.rb which is used on Ruby On Rails. You can browse Entity Relationship Diagram of your schema.rb, on your WebBrowser.
How To Use
Install:
$ gem install schemard
And run:
$ schemard
And browse http://localhost:10080
How To Edit ERD
Edit Layout
In the ERD generated by default, the tables are laid out at random.
You can adjust the position by checking "Edit table position" at the top left of the figure,
And dragging the table.
Add Relation
In the ERD generated by default, there is no relation information between tables.
To add a relation to the ERD, You need to create relation information and load it.
There are several ways to give a relation information.
This section explains how to add relation information based on model information of Rails application.
Extract relation information with the following command. In this example, it outputs to
db/relatoin.metadata
.$ cd <Rails.root.dir> $ schemard gen-relation > db/relation.metadata
To load the extracted relationship information, execute with the following command option.
$ schemard -i <path/to/schema.rb> -f db/relation.metadata
When accessing
http://localhost:10080
in the Web browser, relations are added to the ERD.