https://github.com/v2e4lisp/doterd
ruby dsl for ERD
https://github.com/v2e4lisp/doterd
Last synced: 10 months ago
JSON representation
ruby dsl for ERD
- Host: GitHub
- URL: https://github.com/v2e4lisp/doterd
- Owner: v2e4lisp
- License: mit
- Created: 2014-08-04T03:05:01.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-18T16:24:56.000Z (almost 12 years ago)
- Last Synced: 2025-02-16T16:57:35.932Z (over 1 year ago)
- Language: Ruby
- Size: 254 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Doterd
ruby dsl for erd
## Installation
[graphviz](http://www.graphviz.org/Download_macos.php) should be installed installed.
Add this line to your application's Gemfile:
gem 'doterd'
And then execute:
$ bundle
Or install it yourself as:
$ gem install doterd
## Usage
see `examples/twitter.rb`
```ruby
require 'doterd'
at_exit {
system("open twitter.dot.png")
}
include Doterd::Autodraw
config { |c|
c[:dot_filename] = './twitter.dot'
}
table(:users) {
id
name
email
created_at
update_at
}
table(:followings) {
id
follower_id
followee_id
deleted_at
created_at
updated_at
}
table(:likes) {
id
tweet_id
like_by
created_at
udpated_at
}
table(:retweets) {
id
tweet_id
retweet_by
created_at
udpated_at
}
table(:tweets) {
id
user_id
image_id
text
geo String, "some comment"
created_at "Time", "Comment"
udpated_at
}
_N_N :users , :followings
_1_N :users , :likes
_1_N :users , :tweets
_1_N :users , :retweets
_1_N :tweets , :retweets
_1_N :tweets , :likes
```
