Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MatthewLaFalce/schema_to_md
:zap: Generate beautiful markdown documentation for your PostgreSQL Database from schema.rb files.
https://github.com/MatthewLaFalce/schema_to_md
documentation generator markdown postgresql ruby ruby-on-rails schema
Last synced: 3 months ago
JSON representation
:zap: Generate beautiful markdown documentation for your PostgreSQL Database from schema.rb files.
- Host: GitHub
- URL: https://github.com/MatthewLaFalce/schema_to_md
- Owner: MatthewLaFalce
- License: mit
- Created: 2019-07-23T02:42:43.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-01-15T01:39:36.000Z (almost 4 years ago)
- Last Synced: 2024-06-11T12:46:59.021Z (5 months ago)
- Topics: documentation, generator, markdown, postgresql, ruby, ruby-on-rails, schema
- Language: Ruby
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- jimsghstars - MatthewLaFalce/schema_to_md - :zap: Generate beautiful markdown documentation for your PostgreSQL Database from schema.rb files. (Ruby)
README
Welcome to Schema_to_md 👋
> Generate beautiful markdown documentation for your PostgreSQL Database from schema.rb files.
### 🏠 [Homepage](https://github.com/MatthewLaFalce/schema_to_md)
## Install
```bash
git clone [email protected]:MatthewLaFalce/schema_to_md.git
export PATH=$PATH:~/Github/schema_to_md
# then follow Rails ERD installation below
```## Usage
```bash
# Run this command at the head of any Rails Web App
to_md
```## Rails ERD
```bash
# Requires download of Graphviz
brew install graphviz # Homebrew on Mac OS X
sudo port install graphviz # Macports on Mac OS X
sudo apt install graphviz # Debian and Ubuntu#put this in projects gem file
group :development do
gem 'rails-erd'
end# Then run
bundle install# Generate simple erd
rake erd filetype='png' notation=bachman filename='erd_simple'# Generate complex erd
rake erd polymorphism=true filetype='png' notation=bachman filename='erd_complex'# Most Useful
bundle exec rake erd polymorphism=true filetype='png' notation=bachman filename='erd' exclude='ApplicationRecord,Record,Searchable,PgSearch::Document,ActiveStorage::Attachment,ActiveStorage::Blob'
```## Automated Rails ERD Setup
```yml
# Put this in your projects .erdconfig file
#!/bin/ymlfilename: 'erd'
filetype: 'png'
notation: 'bachman'
polymorphism: true
title: 'Docupiler ER Diagram'
exclude: 'ApplicationRecord,Record,Searchable,PgSearch::Document,ActiveStorage::Attachment,ActiveStorage::Blob,ActiveRecord::InternalMetadata,ActiveRecord::SchemaMigration'
``````ruby
# Put this in your projects Gemfile
group :development do
gem 'rails-erd'
end# Put this in your project Rakefile if you uses :sql for your schema format
Rake::Task["db:migrate"].enhance do
if ActiveRecord::Base.schema_format == :sql
Rake::Task["db:schema:dump"].invoke
end
end# Run this to install the Gem to your project
bundle install# Run this to set up the Rake task to work with db:migrate
bundle exec rails g erd:install# To generate your new diagram just run
bundle exec rails db:migrate
```## Author
👤 **Matthew LaFalce**
* Github: [@MatthewLaFalce](https://github.com/MatthewLaFalce)
## Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/MatthewLaFalce/schema_to_md/issues).## Show your support
Give a ⭐️ if this project helped you!
## License
Copyright © 2019 [Matthew LaFalce](https://github.com/MatthewLaFalce).
This project is [MIT](https://github.com/MatthewLaFalce/schema_to_md/blob/master/LICENSE) licensed.