erd 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{README.rdoc → README.md} +26 -20
- data/app/controllers/erd/erd_controller.rb +9 -2
- data/lib/erd/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 23d4342f2a320f75b2e90d11bf2474d5f1878632369e6c5a9e3608f3c9ac9aee
|
4
|
+
data.tar.gz: d7b53a5993a0b95508e44be666ec68f620563e4a9ee7bfb7ef708f09beb0ffda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37a889901a16afac747792e929a71a8831ff55b0119cdb5cf96911fb19447a493a717021c7a65c1e7d3274809af67dd64c6a0184f79aebfa09716198186d38f8
|
7
|
+
data.tar.gz: c87a23f1c22cbff2363b8f54d993be86669330854fd80bd9570df87b3f144434c9ad55aacceacdf08f95b0fe60ff0cf67d4a145ee1918c22c1cba2b7b8b31b15
|
data/{README.rdoc → README.md}
RENAMED
@@ -1,43 +1,49 @@
|
|
1
|
-
|
1
|
+
# Erd
|
2
2
|
|
3
3
|
A Rails engine for drawing your app's ER diagram and operating migrations
|
4
4
|
|
5
5
|
|
6
|
-
|
6
|
+
## Requirements
|
7
7
|
|
8
8
|
* Rails 5.2, 5.1, 5.0, 4.2, 4.1, 4.0, 3.2, or 3.1
|
9
9
|
|
10
10
|
* Graphviz
|
11
11
|
|
12
12
|
|
13
|
-
|
13
|
+
## Installation
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
Bundle 'erd' gem to your existing Rails app's Gemfile:
|
16
|
+
```ruby
|
17
|
+
gem 'erd', group: :development
|
17
18
|
|
18
|
-
|
19
|
-
% bundle
|
19
|
+
```
|
20
20
|
|
21
21
|
|
22
|
-
|
22
|
+
## Usage
|
23
23
|
|
24
24
|
Browse at your http://localhost:3000/erd
|
25
25
|
|
26
26
|
|
27
|
-
|
27
|
+
## Features
|
28
28
|
|
29
|
-
|
29
|
+
### Show Mode
|
30
30
|
|
31
|
-
*
|
31
|
+
* Erd draws an ER diagram based on your app's database and models.
|
32
32
|
|
33
|
-
* You can
|
33
|
+
* You can drag and arrange the positions of each model.
|
34
34
|
|
35
|
-
* Then
|
35
|
+
* Then you can save the positions to a local file `db/erd_positions.json`, so you can share the diagram between the team members.
|
36
36
|
|
37
|
-
|
37
|
+
### Edit Mode
|
38
38
|
|
39
|
+
* You can operate DB schema manipulations such as `add column`, `rename column`, `alter column`, `create model (as well as table)`, and `drop table`.
|
39
40
|
|
40
|
-
|
41
|
+
* Then, Erd generates migration files on the server.
|
42
|
+
|
43
|
+
* And you can run each migration on your browser super quickly.
|
44
|
+
|
45
|
+
|
46
|
+
## TODO
|
41
47
|
|
42
48
|
* Fix buggy JS
|
43
49
|
|
@@ -50,17 +56,17 @@ Browse at your http://localhost:3000/erd
|
|
50
56
|
* cleaner code (the code is horrible. Please don't read the code, though of course your patches welcome)
|
51
57
|
|
52
58
|
|
53
|
-
|
59
|
+
## Contributing to Erd
|
54
60
|
|
55
61
|
* Send me your pull requests!
|
56
62
|
|
57
63
|
|
58
|
-
|
64
|
+
## Team
|
59
65
|
|
60
|
-
*
|
61
|
-
*
|
66
|
+
* [Akira Matsuda][https://github.com/amatsuda]
|
67
|
+
* [Teppei Machida][http://github.com/machida] (design)
|
62
68
|
|
63
69
|
|
64
|
-
|
70
|
+
## Copyright
|
65
71
|
|
66
72
|
Copyright (c) 2012 Akira Matsuda. See MIT-LICENSE for further details.
|
@@ -6,7 +6,8 @@ require 'erd/application_controller'
|
|
6
6
|
|
7
7
|
module Erd
|
8
8
|
class ErdController < ::Erd::ApplicationController
|
9
|
-
POSITIONS_JSON_FILE = Rails.root.join('
|
9
|
+
POSITIONS_JSON_FILE = Rails.root.join('db/erd_positions.json').freeze
|
10
|
+
OLD_POSITIONS_JSON_FILE = Rails.root.join('db/erd_positions.json').freeze # for compatibility
|
10
11
|
|
11
12
|
def index
|
12
13
|
@erd = render_plain generate_plain, saved_positions
|
@@ -80,7 +81,13 @@ module Erd
|
|
80
81
|
private
|
81
82
|
|
82
83
|
def saved_positions
|
83
|
-
POSITIONS_JSON_FILE.exist?
|
84
|
+
if POSITIONS_JSON_FILE.exist?
|
85
|
+
ActiveSupport::JSON.decode(POSITIONS_JSON_FILE.read)
|
86
|
+
elsif OLD_POSITIONS_JSON_FILE.exist?
|
87
|
+
ActiveSupport::JSON.decode(OLD_POSITIONS_JSON_FILE.read)
|
88
|
+
else
|
89
|
+
{}
|
90
|
+
end
|
84
91
|
end
|
85
92
|
|
86
93
|
def generate_plain
|
data/lib/erd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Akira Matsuda
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-11-
|
11
|
+
date: 2020-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby-graphviz
|
@@ -161,7 +161,7 @@ files:
|
|
161
161
|
- ".travis.yml"
|
162
162
|
- Gemfile
|
163
163
|
- MIT-LICENSE
|
164
|
-
- README.
|
164
|
+
- README.md
|
165
165
|
- Rakefile
|
166
166
|
- app/controllers/erd/application_controller.rb
|
167
167
|
- app/controllers/erd/erd_controller.rb
|