Project

yml2erd

0.0
No commit activity in last 3 years
No release in over 3 years
This gem generates erd from a simple yml.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
>= 0
~> 10.0
~> 3.0

Runtime

 Project Readme

Yml2erd

Build Status

yml2erd generates erd easily.

output_image

Installation

Before install this gem, you need to install graphviz.

$ brew install graphviz

You can get more about graphviz from here.

This is how to install yml2erd, just run gem install yml2erd

$ gem install yml2erd

Usage

Run this,

$ yml2erd convert structure.yml

and we get output.png.

$ yml2erd help convert
Usage:
  yml2erd convert <path>

Options:
  o, [--output=FILE_PATH]          # default: output.png
  p, [--projectname=PROJECT_NAME]  # default: null
  s, [--outputstyle=OUTPUT_STYLE]  # svg or png, default: png

Convert erd from yml

Rule

You must write yml just like below

# basic format
<table_name>:
  columns:
    - <column_name>: <column_type>
  relations:
    belongs_to:
      - <table_name>
    has_many:
      - <table_name>
  index:
    - <column_name>

belongs_to or has_many is not necessary.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/asmsuechan/yml2erd.

License

The gem is available as open source under the terms of the MIT License.