lol_dba 2.1.5 → 2.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +179 -0
- data/.gitignore +1 -1
- data/.rspec +2 -0
- data/.rubocop.yml +7 -0
- data/.travis.yml +16 -9
- data/Appraisals +19 -12
- data/Gemfile +1 -8
- data/Gemfile.lock +60 -59
- data/README.md +5 -2
- data/Rakefile +4 -4
- data/bin/lol_dba +2 -2
- data/gemfiles/rails_3_2.gemfile +0 -3
- data/gemfiles/rails_3_2.gemfile.lock +33 -31
- data/gemfiles/rails_4_0.gemfile +0 -3
- data/gemfiles/rails_4_0.gemfile.lock +31 -27
- data/gemfiles/rails_4_1.gemfile +0 -3
- data/gemfiles/rails_4_1.gemfile.lock +29 -26
- data/gemfiles/rails_4_2.gemfile +0 -3
- data/gemfiles/rails_4_2.gemfile.lock +52 -48
- data/gemfiles/rails_5_0.gemfile +0 -3
- data/gemfiles/rails_5_0.gemfile.lock +55 -51
- data/gemfiles/rails_5_1.gemfile +0 -3
- data/gemfiles/rails_5_1.gemfile.lock +57 -53
- data/gemfiles/rails_5_2.gemfile +9 -0
- data/gemfiles/rails_5_2.gemfile.lock +115 -0
- data/lib/lol_dba/cli.rb +26 -15
- data/lib/lol_dba/index_finding/belongs_to.rb +32 -0
- data/lib/lol_dba/index_finding/error_logging.rb +15 -0
- data/lib/lol_dba/index_finding/has_and_belongs_to_many.rb +20 -0
- data/lib/lol_dba/index_finding/has_many.rb +47 -0
- data/lib/lol_dba/index_finding/index_finder.rb +81 -0
- data/lib/lol_dba/index_finding/migration_formatter.rb +50 -0
- data/lib/lol_dba/index_finding/relation_inspector.rb +30 -0
- data/lib/lol_dba/index_finding/relation_inspector_factory.rb +13 -0
- data/lib/lol_dba/rails_compatibility.rb +47 -0
- data/lib/lol_dba/railtie.rb +2 -2
- data/lib/lol_dba/sql_migrations/migration.rb +51 -0
- data/lib/lol_dba/sql_migrations/migration_mocker.rb +70 -0
- data/lib/lol_dba/sql_migrations/sql_generator.rb +49 -0
- data/lib/lol_dba/sql_migrations/writer.rb +29 -0
- data/lib/lol_dba/version.rb +1 -1
- data/lib/lol_dba.rb +14 -188
- data/lib/tasks/lol_dba.rake +7 -8
- data/lol_dba.gemspec +19 -16
- data/spec/associations_index_spec.rb +43 -56
- data/spec/fixtures/app/models/address.rb +0 -1
- data/spec/fixtures/app/models/billable_week.rb +1 -3
- data/spec/fixtures/app/models/company.rb +0 -1
- data/spec/fixtures/app/models/complex_billable_week.rb +0 -1
- data/spec/fixtures/app/models/complex_timesheet.rb +0 -1
- data/spec/fixtures/app/models/country.rb +1 -1
- data/spec/fixtures/app/models/favourite.rb +0 -2
- data/spec/fixtures/app/models/freelancer.rb +1 -3
- data/spec/fixtures/app/models/gift.rb +0 -2
- data/spec/fixtures/app/models/god.rb +1 -1
- data/spec/fixtures/app/models/project.rb +0 -2
- data/spec/fixtures/app/models/timesheet.rb +1 -3
- data/spec/fixtures/app/models/user.rb +0 -2
- data/spec/fixtures/app/models/worker.rb +0 -1
- data/spec/fixtures/app/models/worker_user.rb +2 -3
- data/spec/fixtures/schema.rb +53 -53
- data/spec/migration_formatter_spec.rb +66 -0
- data/spec/spec_helper.rb +17 -9
- data/spec/sql_generator_spec.rb +9 -0
- metadata +88 -19
- data/lib/lol_dba/migration.rb +0 -40
- data/lib/lol_dba/sql_generator.rb +0 -96
- data/lib/lol_dba/writer.rb +0 -25
- data/spec/common_function_spec.rb +0 -96
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5abd645679d425a5411af04abe6304972bc8a61217c9b2315b4d5c94bba71778
|
4
|
+
data.tar.gz: '0499e53412cae045453e7a10af289be782064a9bdefa09a10538dd14e80f6b7d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5bf9976dae1fb84858117d4d4b3f38c4f09dd228fae99f2d344c7bb75b399d32a912503013ffe084ea9e72757fc603e9ba6185c1d553040c5d3f16dc483486ab
|
7
|
+
data.tar.gz: 5dfe66d6171f7516fd928ad765815693cd0f9a91030c74ac8db5959c18835ac076d51b9141c70e6171b59dce1669208951ec9ed66d77537f256c67c65f57c34b
|
data/.codeclimate.yml
ADDED
@@ -0,0 +1,179 @@
|
|
1
|
+
|
2
|
+
{
|
3
|
+
"checks": {
|
4
|
+
"argument-count": {
|
5
|
+
"enabled": true
|
6
|
+
},
|
7
|
+
"complex-logic": {
|
8
|
+
"enabled": true
|
9
|
+
},
|
10
|
+
"file-lines": {
|
11
|
+
"enabled": true
|
12
|
+
},
|
13
|
+
"identical-code": {
|
14
|
+
"enabled": true
|
15
|
+
},
|
16
|
+
"method-complexity": {
|
17
|
+
"enabled": true
|
18
|
+
},
|
19
|
+
"method-count": {
|
20
|
+
"enabled": true
|
21
|
+
},
|
22
|
+
"method-lines": {
|
23
|
+
"enabled": true
|
24
|
+
},
|
25
|
+
"nested-control-flow": {
|
26
|
+
"enabled": true
|
27
|
+
},
|
28
|
+
"return-statements": {
|
29
|
+
"enabled": true
|
30
|
+
},
|
31
|
+
"similar-code": {
|
32
|
+
"enabled": true
|
33
|
+
}
|
34
|
+
},
|
35
|
+
"exclude_patterns": [
|
36
|
+
"config/",
|
37
|
+
"db/",
|
38
|
+
"dist/",
|
39
|
+
"features/",
|
40
|
+
"**/node_modules/",
|
41
|
+
"script/",
|
42
|
+
"**/spec/",
|
43
|
+
"**/test/",
|
44
|
+
"**/tests/",
|
45
|
+
"Tests/",
|
46
|
+
"**/vendor/",
|
47
|
+
"**/*_test.go",
|
48
|
+
"**/*.d.ts"
|
49
|
+
],
|
50
|
+
"plugins": {
|
51
|
+
"apexmetrics": {
|
52
|
+
"enabled": true
|
53
|
+
},
|
54
|
+
"brakeman": {
|
55
|
+
"enabled": false
|
56
|
+
},
|
57
|
+
"brakeman-pro": {
|
58
|
+
"enabled": false
|
59
|
+
},
|
60
|
+
"bundler-audit": {
|
61
|
+
"enabled": true
|
62
|
+
},
|
63
|
+
"checkstyle": {
|
64
|
+
"enabled": false
|
65
|
+
},
|
66
|
+
"coffeelint": {
|
67
|
+
"enabled": false
|
68
|
+
},
|
69
|
+
"csslint": {
|
70
|
+
"enabled": false
|
71
|
+
},
|
72
|
+
"eslint": {
|
73
|
+
"enabled": false
|
74
|
+
},
|
75
|
+
"fixme": {
|
76
|
+
"enabled": true
|
77
|
+
},
|
78
|
+
"flog": {
|
79
|
+
"enabled": true
|
80
|
+
},
|
81
|
+
"foodcritic": {
|
82
|
+
"enabled": false
|
83
|
+
},
|
84
|
+
"git-legal": {
|
85
|
+
"enabled": true
|
86
|
+
},
|
87
|
+
"gnu-complexity": {
|
88
|
+
"enabled": false
|
89
|
+
},
|
90
|
+
"gofmt": {
|
91
|
+
"enabled": false
|
92
|
+
},
|
93
|
+
"golint": {
|
94
|
+
"enabled": false
|
95
|
+
},
|
96
|
+
"govet": {
|
97
|
+
"enabled": false
|
98
|
+
},
|
99
|
+
"grep": {
|
100
|
+
"enabled": false
|
101
|
+
},
|
102
|
+
"haxe-checkstyle": {
|
103
|
+
"enabled": false
|
104
|
+
},
|
105
|
+
"hlint": {
|
106
|
+
"enabled": false
|
107
|
+
},
|
108
|
+
"kibit": {
|
109
|
+
"enabled": false
|
110
|
+
},
|
111
|
+
"markdownlint": {
|
112
|
+
"enabled": false
|
113
|
+
},
|
114
|
+
"nodesecurity": {
|
115
|
+
"enabled": false
|
116
|
+
},
|
117
|
+
"pep8": {
|
118
|
+
"enabled": false
|
119
|
+
},
|
120
|
+
"phan": {
|
121
|
+
"enabled": false
|
122
|
+
},
|
123
|
+
"phpcodesniffer": {
|
124
|
+
"enabled": false
|
125
|
+
},
|
126
|
+
"phpmd": {
|
127
|
+
"enabled": false
|
128
|
+
},
|
129
|
+
"pmd": {
|
130
|
+
"enabled": false
|
131
|
+
},
|
132
|
+
"radon": {
|
133
|
+
"enabled": false
|
134
|
+
},
|
135
|
+
"reek": {
|
136
|
+
"enabled": true
|
137
|
+
},
|
138
|
+
"rubocop": {
|
139
|
+
"enabled": true
|
140
|
+
},
|
141
|
+
"rubymotion": {
|
142
|
+
"enabled": false
|
143
|
+
},
|
144
|
+
"shellcheck": {
|
145
|
+
"enabled": false
|
146
|
+
},
|
147
|
+
"scss-lint": {
|
148
|
+
"enabled": false
|
149
|
+
},
|
150
|
+
"sonar-java": {
|
151
|
+
"enabled": false
|
152
|
+
},
|
153
|
+
"sonar-php": {
|
154
|
+
"enabled": false
|
155
|
+
},
|
156
|
+
"sonar-python": {
|
157
|
+
"enabled": false
|
158
|
+
},
|
159
|
+
"stylelint": {
|
160
|
+
"enabled": false
|
161
|
+
},
|
162
|
+
"swiftlint": {
|
163
|
+
"enabled": false
|
164
|
+
},
|
165
|
+
"tailor": {
|
166
|
+
"enabled": false
|
167
|
+
},
|
168
|
+
"tslint": {
|
169
|
+
"enabled": false
|
170
|
+
},
|
171
|
+
"vint": {
|
172
|
+
"enabled": false
|
173
|
+
},
|
174
|
+
"watson": {
|
175
|
+
"enabled": false
|
176
|
+
}
|
177
|
+
},
|
178
|
+
"version": "2"
|
179
|
+
}
|
data/.gitignore
CHANGED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.travis.yml
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
env:
|
2
|
+
global:
|
3
|
+
- CC_TEST_REPORTER_ID=46e5fb2273e7c6fb1beaad7c0f14ad898f0eed65d98a20c80fe8eb4e216a7ff0
|
3
4
|
sudo: false
|
4
5
|
language: ruby
|
6
|
+
cache: bundler
|
7
|
+
before_install:
|
8
|
+
- gem update --system
|
9
|
+
- gem install bundler
|
5
10
|
rvm:
|
6
|
-
- 2.
|
7
|
-
- 2.3.6
|
8
|
-
- 2.4.3
|
9
|
-
- 2.5.0
|
11
|
+
- 2.6.1
|
10
12
|
- ruby-head
|
11
13
|
gemfile:
|
12
14
|
- gemfiles/rails_3_2.gemfile
|
@@ -15,13 +17,18 @@ gemfile:
|
|
15
17
|
- gemfiles/rails_4_2.gemfile
|
16
18
|
- gemfiles/rails_5_0.gemfile
|
17
19
|
- gemfiles/rails_5_1.gemfile
|
20
|
+
- gemfiles/rails_5_2.gemfile
|
21
|
+
before_script:
|
22
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
23
|
+
- chmod +x ./cc-test-reporter
|
24
|
+
- ./cc-test-reporter before-build
|
18
25
|
script: "bundle exec rake"
|
26
|
+
after_script:
|
27
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
19
28
|
notifications:
|
20
29
|
recipients:
|
21
|
-
- diego@plentz.
|
30
|
+
- diego@plentz.io
|
22
31
|
matrix:
|
23
32
|
fast_finish: true
|
24
33
|
allow_failures:
|
25
|
-
- rvm: 2.2.9
|
26
|
-
- rvm: 2.3.6
|
27
34
|
- rvm: ruby-head
|
data/Appraisals
CHANGED
@@ -1,40 +1,47 @@
|
|
1
|
-
appraise
|
2
|
-
version =
|
1
|
+
appraise 'rails_3_2' do
|
2
|
+
version = '~> 3.2.21'
|
3
3
|
gem 'activerecord', version
|
4
4
|
gem 'actionpack', version
|
5
5
|
gem 'railties', version
|
6
6
|
end
|
7
7
|
|
8
|
-
appraise
|
9
|
-
version =
|
8
|
+
appraise 'rails_4_0' do
|
9
|
+
version = '~> 4.0.13'
|
10
10
|
gem 'activerecord', version
|
11
11
|
gem 'actionpack', version
|
12
12
|
gem 'railties', version
|
13
13
|
end
|
14
14
|
|
15
|
-
appraise
|
16
|
-
version =
|
15
|
+
appraise 'rails_4_1' do
|
16
|
+
version = '~> 4.1.9'
|
17
17
|
gem 'activerecord', version
|
18
18
|
gem 'actionpack', version
|
19
19
|
gem 'railties', version
|
20
20
|
end
|
21
21
|
|
22
|
-
appraise
|
23
|
-
version =
|
22
|
+
appraise 'rails_4_2' do
|
23
|
+
version = '~> 4.2.0'
|
24
24
|
gem 'activerecord', version
|
25
25
|
gem 'actionpack', version
|
26
26
|
gem 'railties', version
|
27
27
|
end
|
28
28
|
|
29
|
-
appraise
|
30
|
-
version =
|
29
|
+
appraise 'rails_5_0' do
|
30
|
+
version = '~> 5.0.0'
|
31
31
|
gem 'activerecord', version
|
32
32
|
gem 'actionpack', version
|
33
33
|
gem 'railties', version
|
34
34
|
end
|
35
35
|
|
36
|
-
appraise
|
37
|
-
version =
|
36
|
+
appraise 'rails_5_1' do
|
37
|
+
version = '~> 5.1.0'
|
38
|
+
gem 'activerecord', version
|
39
|
+
gem 'actionpack', version
|
40
|
+
gem 'railties', version
|
41
|
+
end
|
42
|
+
|
43
|
+
appraise 'rails_5_2' do
|
44
|
+
version = '~> 5.2.0'
|
38
45
|
gem 'activerecord', version
|
39
46
|
gem 'actionpack', version
|
40
47
|
gem 'railties', version
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,95 +1,99 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lol_dba (2.1.
|
5
|
-
actionpack (>= 3.0)
|
6
|
-
activerecord (>= 3.0)
|
7
|
-
railties (>= 3.0)
|
4
|
+
lol_dba (2.1.5)
|
5
|
+
actionpack (>= 3.0, < 6.0)
|
6
|
+
activerecord (>= 3.0, < 6.0)
|
7
|
+
railties (>= 3.0, < 6.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
actionpack (5.
|
13
|
-
actionview (= 5.
|
14
|
-
activesupport (= 5.
|
12
|
+
actionpack (5.2.3)
|
13
|
+
actionview (= 5.2.3)
|
14
|
+
activesupport (= 5.2.3)
|
15
15
|
rack (~> 2.0)
|
16
16
|
rack-test (>= 0.6.3)
|
17
17
|
rails-dom-testing (~> 2.0)
|
18
18
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
19
|
-
actionview (5.
|
20
|
-
activesupport (= 5.
|
19
|
+
actionview (5.2.3)
|
20
|
+
activesupport (= 5.2.3)
|
21
21
|
builder (~> 3.1)
|
22
22
|
erubi (~> 1.4)
|
23
23
|
rails-dom-testing (~> 2.0)
|
24
24
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
25
|
-
activemodel (5.
|
26
|
-
activesupport (= 5.
|
27
|
-
activerecord (5.
|
28
|
-
activemodel (= 5.
|
29
|
-
activesupport (= 5.
|
30
|
-
arel (
|
31
|
-
activesupport (5.
|
25
|
+
activemodel (5.2.3)
|
26
|
+
activesupport (= 5.2.3)
|
27
|
+
activerecord (5.2.3)
|
28
|
+
activemodel (= 5.2.3)
|
29
|
+
activesupport (= 5.2.3)
|
30
|
+
arel (>= 9.0)
|
31
|
+
activesupport (5.2.3)
|
32
32
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
33
|
-
i18n (
|
33
|
+
i18n (>= 0.7, < 2)
|
34
34
|
minitest (~> 5.1)
|
35
35
|
tzinfo (~> 1.1)
|
36
36
|
appraisal (2.2.0)
|
37
37
|
bundler
|
38
38
|
rake
|
39
39
|
thor (>= 0.14.0)
|
40
|
-
arel (
|
40
|
+
arel (9.0.0)
|
41
41
|
builder (3.2.3)
|
42
|
-
concurrent-ruby (1.
|
43
|
-
crass (1.0.
|
42
|
+
concurrent-ruby (1.1.5)
|
43
|
+
crass (1.0.4)
|
44
44
|
diff-lcs (1.3)
|
45
|
-
|
46
|
-
|
45
|
+
docile (1.3.1)
|
46
|
+
erubi (1.8.0)
|
47
|
+
i18n (1.6.0)
|
47
48
|
concurrent-ruby (~> 1.0)
|
48
|
-
|
49
|
+
json (2.2.0)
|
50
|
+
loofah (2.2.3)
|
49
51
|
crass (~> 1.0.2)
|
50
52
|
nokogiri (>= 1.5.9)
|
51
|
-
method_source (0.9.
|
52
|
-
mini_portile2 (2.
|
53
|
+
method_source (0.9.2)
|
54
|
+
mini_portile2 (2.4.0)
|
53
55
|
minitest (5.11.3)
|
54
|
-
nokogiri (1.
|
55
|
-
mini_portile2 (~> 2.
|
56
|
-
|
57
|
-
rack (
|
58
|
-
rack-test (0.8.3)
|
56
|
+
nokogiri (1.10.2)
|
57
|
+
mini_portile2 (~> 2.4.0)
|
58
|
+
rack (2.0.7)
|
59
|
+
rack-test (1.1.0)
|
59
60
|
rack (>= 1.0, < 3)
|
60
61
|
rails-dom-testing (2.0.3)
|
61
62
|
activesupport (>= 4.2.0)
|
62
63
|
nokogiri (>= 1.6)
|
63
|
-
rails-html-sanitizer (1.0.
|
64
|
-
loofah (~> 2.
|
65
|
-
railties (5.
|
66
|
-
actionpack (= 5.
|
67
|
-
activesupport (= 5.
|
64
|
+
rails-html-sanitizer (1.0.4)
|
65
|
+
loofah (~> 2.2, >= 2.2.2)
|
66
|
+
railties (5.2.3)
|
67
|
+
actionpack (= 5.2.3)
|
68
|
+
activesupport (= 5.2.3)
|
68
69
|
method_source
|
69
70
|
rake (>= 0.8.7)
|
70
|
-
thor (>= 0.
|
71
|
-
rake (12.3.
|
72
|
-
rspec-core (3.
|
73
|
-
rspec-support (~> 3.
|
74
|
-
rspec-expectations (3.
|
71
|
+
thor (>= 0.19.0, < 2.0)
|
72
|
+
rake (12.3.2)
|
73
|
+
rspec-core (3.8.0)
|
74
|
+
rspec-support (~> 3.8.0)
|
75
|
+
rspec-expectations (3.8.2)
|
75
76
|
diff-lcs (>= 1.2.0, < 2.0)
|
76
|
-
rspec-support (~> 3.
|
77
|
-
rspec-mocks (3.
|
77
|
+
rspec-support (~> 3.8.0)
|
78
|
+
rspec-mocks (3.8.0)
|
78
79
|
diff-lcs (>= 1.2.0, < 2.0)
|
79
|
-
rspec-support (~> 3.
|
80
|
-
rspec-rails (3.
|
80
|
+
rspec-support (~> 3.8.0)
|
81
|
+
rspec-rails (3.8.2)
|
81
82
|
actionpack (>= 3.0)
|
82
83
|
activesupport (>= 3.0)
|
83
84
|
railties (>= 3.0)
|
84
|
-
rspec-core (~> 3.
|
85
|
-
rspec-expectations (~> 3.
|
86
|
-
rspec-mocks (~> 3.
|
87
|
-
rspec-support (~> 3.
|
88
|
-
rspec-support (3.
|
85
|
+
rspec-core (~> 3.8.0)
|
86
|
+
rspec-expectations (~> 3.8.0)
|
87
|
+
rspec-mocks (~> 3.8.0)
|
88
|
+
rspec-support (~> 3.8.0)
|
89
|
+
rspec-support (3.8.0)
|
90
|
+
simplecov (0.16.1)
|
91
|
+
docile (~> 1.1)
|
92
|
+
json (>= 1.8, < 3)
|
93
|
+
simplecov-html (~> 0.10.0)
|
94
|
+
simplecov-html (0.10.2)
|
89
95
|
sqlite3 (1.3.13)
|
90
|
-
|
91
|
-
power_assert
|
92
|
-
thor (0.20.0)
|
96
|
+
thor (0.20.3)
|
93
97
|
thread_safe (0.3.6)
|
94
98
|
tzinfo (1.2.5)
|
95
99
|
thread_safe (~> 0.1)
|
@@ -98,14 +102,11 @@ PLATFORMS
|
|
98
102
|
ruby
|
99
103
|
|
100
104
|
DEPENDENCIES
|
101
|
-
|
102
|
-
activerecord
|
103
|
-
appraisal
|
105
|
+
appraisal (~> 2.2)
|
104
106
|
lol_dba!
|
105
|
-
railties
|
106
107
|
rspec-rails
|
107
|
-
|
108
|
-
|
108
|
+
simplecov (~> 0.1)
|
109
|
+
sqlite3 (~> 1.3.5)
|
109
110
|
|
110
111
|
BUNDLED WITH
|
111
|
-
1.
|
112
|
+
1.17.3
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
# lol_dba [![travis](https://api.travis-ci.org/plentz/lol_dba.svg?branch=master)](https://travis-ci.org/plentz/lol_dba)
|
1
|
+
# lol_dba [![travis](https://api.travis-ci.org/plentz/lol_dba.svg?branch=master)](https://travis-ci.org/plentz/lol_dba) [![Maintainability](https://api.codeclimate.com/v1/badges/a5cc1172ec1291536904/maintainability)](https://codeclimate.com/github/plentz/lol_dba/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/a5cc1172ec1291536904/test_coverage)](https://codeclimate.com/github/plentz/lol_dba/test_coverage)
|
2
2
|
|
3
|
-
lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
|
3
|
+
lol_dba is a small package of rake tasks that scan your application models and displays a list of columns that probably should be indexed. Also, it can generate .sql migration scripts.
|
4
4
|
|
5
5
|
### Quick example
|
6
6
|
|
@@ -55,6 +55,9 @@ To run lol_dba tests, just clone the repo and run:
|
|
55
55
|
|
56
56
|
bundle install && rake
|
57
57
|
|
58
|
+
### Contributors
|
59
|
+
Most of the initial code came from [rails_indexes](https://github.com/warpc/rails_indexes) and [migration_sql_generator](https://github.com/muness/migration_sql_generator). [Other people helped as well](https://github.com/plentz/lol_dba/graphs/contributors).
|
60
|
+
|
58
61
|
### License
|
59
62
|
|
60
63
|
Lol DBA is released under the MIT license.
|
data/Rakefile
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
require 'rubygems'
|
2
2
|
require 'rspec/core/rake_task'
|
3
3
|
require 'rdoc/task'
|
4
|
-
require
|
4
|
+
require 'appraisal'
|
5
5
|
|
6
|
-
if !ENV[
|
6
|
+
if !ENV['APPRAISAL_INITIALIZED'] && !ENV['TRAVIS']
|
7
7
|
desc 'Default: run unit tests with appraisal.'
|
8
8
|
task :default do
|
9
|
-
sh
|
9
|
+
sh 'appraisal install && rake appraisal spec'
|
10
10
|
end
|
11
11
|
else
|
12
12
|
desc 'Default: run unit tests.'
|
13
|
-
task :
|
13
|
+
task default: :spec
|
14
14
|
end
|
15
15
|
|
16
16
|
desc 'Testing the rails indexes plugin.'
|
data/bin/lol_dba
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
|
-
if File.
|
4
|
-
|
3
|
+
if File.exist?(File.join(File.expand_path('..', __dir__), '.git'))
|
4
|
+
$LOAD_PATH.unshift(File.expand_path('../lib', __dir__))
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'lol_dba'
|
data/gemfiles/rails_3_2.gemfile
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
lol_dba (2.1.
|
5
|
-
actionpack (>= 3.0)
|
6
|
-
activerecord (>= 3.0)
|
7
|
-
railties (>= 3.0)
|
4
|
+
lol_dba (2.1.5)
|
5
|
+
actionpack (>= 3.0, < 6.0)
|
6
|
+
activerecord (>= 3.0, < 6.0)
|
7
|
+
railties (>= 3.0, < 6.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -36,18 +36,18 @@ GEM
|
|
36
36
|
thor (>= 0.14.0)
|
37
37
|
arel (3.0.3)
|
38
38
|
builder (3.0.4)
|
39
|
-
concurrent-ruby (1.
|
39
|
+
concurrent-ruby (1.1.5)
|
40
40
|
diff-lcs (1.3)
|
41
|
+
docile (1.3.1)
|
41
42
|
erubis (2.7.0)
|
42
43
|
hike (1.2.3)
|
43
44
|
i18n (0.9.5)
|
44
45
|
concurrent-ruby (~> 1.0)
|
45
46
|
journey (1.0.4)
|
46
|
-
json (
|
47
|
+
json (2.2.0)
|
47
48
|
multi_json (1.13.1)
|
48
|
-
power_assert (1.1.1)
|
49
49
|
rack (1.4.7)
|
50
|
-
rack-cache (1.
|
50
|
+
rack-cache (1.9.0)
|
51
51
|
rack (>= 0.4)
|
52
52
|
rack-ssl (1.3.4)
|
53
53
|
rack
|
@@ -60,37 +60,39 @@ GEM
|
|
60
60
|
rake (>= 0.8.7)
|
61
61
|
rdoc (~> 3.4)
|
62
62
|
thor (>= 0.14.6, < 2.0)
|
63
|
-
rake (12.3.
|
64
|
-
rdoc (3.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
rspec-expectations (3.7.0)
|
63
|
+
rake (12.3.2)
|
64
|
+
rdoc (3.9.5)
|
65
|
+
rspec-core (3.8.0)
|
66
|
+
rspec-support (~> 3.8.0)
|
67
|
+
rspec-expectations (3.8.2)
|
69
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
70
|
-
rspec-support (~> 3.
|
71
|
-
rspec-mocks (3.
|
69
|
+
rspec-support (~> 3.8.0)
|
70
|
+
rspec-mocks (3.8.0)
|
72
71
|
diff-lcs (>= 1.2.0, < 2.0)
|
73
|
-
rspec-support (~> 3.
|
74
|
-
rspec-rails (3.
|
72
|
+
rspec-support (~> 3.8.0)
|
73
|
+
rspec-rails (3.8.2)
|
75
74
|
actionpack (>= 3.0)
|
76
75
|
activesupport (>= 3.0)
|
77
76
|
railties (>= 3.0)
|
78
|
-
rspec-core (~> 3.
|
79
|
-
rspec-expectations (~> 3.
|
80
|
-
rspec-mocks (~> 3.
|
81
|
-
rspec-support (~> 3.
|
82
|
-
rspec-support (3.
|
77
|
+
rspec-core (~> 3.8.0)
|
78
|
+
rspec-expectations (~> 3.8.0)
|
79
|
+
rspec-mocks (~> 3.8.0)
|
80
|
+
rspec-support (~> 3.8.0)
|
81
|
+
rspec-support (3.8.0)
|
82
|
+
simplecov (0.16.1)
|
83
|
+
docile (~> 1.1)
|
84
|
+
json (>= 1.8, < 3)
|
85
|
+
simplecov-html (~> 0.10.0)
|
86
|
+
simplecov-html (0.10.2)
|
83
87
|
sprockets (2.2.3)
|
84
88
|
hike (~> 1.2)
|
85
89
|
multi_json (~> 1.0)
|
86
90
|
rack (~> 1.0)
|
87
91
|
tilt (~> 1.1, != 1.3.0)
|
88
92
|
sqlite3 (1.3.13)
|
89
|
-
|
90
|
-
power_assert
|
91
|
-
thor (0.20.0)
|
93
|
+
thor (0.20.3)
|
92
94
|
tilt (1.4.1)
|
93
|
-
tzinfo (0.3.
|
95
|
+
tzinfo (0.3.55)
|
94
96
|
|
95
97
|
PLATFORMS
|
96
98
|
ruby
|
@@ -98,12 +100,12 @@ PLATFORMS
|
|
98
100
|
DEPENDENCIES
|
99
101
|
actionpack (~> 3.2.21)
|
100
102
|
activerecord (~> 3.2.21)
|
101
|
-
appraisal
|
103
|
+
appraisal (~> 2.2)
|
102
104
|
lol_dba!
|
103
105
|
railties (~> 3.2.21)
|
104
106
|
rspec-rails
|
105
|
-
|
106
|
-
|
107
|
+
simplecov (~> 0.1)
|
108
|
+
sqlite3 (~> 1.3.5)
|
107
109
|
|
108
110
|
BUNDLED WITH
|
109
|
-
1.
|
111
|
+
1.17.3
|