lol_dba 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 095775b96e5bc0e22e261e1e55fc03d3f2c0dc94
4
- data.tar.gz: 84ae3baeef1d90f247acde65f52518d3b2c4079d
3
+ metadata.gz: 1eb862f72474561328443108c60b5471004f6b4c
4
+ data.tar.gz: c41dd4604eaa71dc66086a894b349baa5736e07a
5
5
  SHA512:
6
- metadata.gz: 38aa20f992b87c89f3635dbded75b1236f09872a68f1c25268328fb5fb1b6acb5dd69fd428c7021759b3df8cd9613fe9afb871c6a253835d64762ea94f4b1c37
7
- data.tar.gz: 481dfd01822e773ae806f85654a99e7bddf32fd60827cb60a133fd02edf61bc8cef9d6d0ee7735ba8dc639d4d31ca43019d0c0f80f18e01b4238dab82a9698ad
6
+ metadata.gz: 9d26a8031db16786d8af5d31c6d420f48560c8b514468bdd0861994929e1d5d2b6f04cca13ab3cd36e0fb1fe5cfde3c759def79452d6acb8dfbe46ded5709936
7
+ data.tar.gz: 9df7446dff0854eea8a597a13e9f01fe4f306057895ce98280b0bf45bfdeebac8a149643eec1ecd193bce901d54ed5b8880e6dbae2d26cacead990f333c5b330
@@ -3,15 +3,16 @@
3
3
  sudo: false
4
4
  language: ruby
5
5
  rvm:
6
- - 2.0
7
- - 2.1
8
- - 2.2
6
+ - 2.2.6
7
+ - 2.3.3
8
+ - 2.4.0
9
9
  - ruby-head
10
10
  gemfile:
11
11
  - gemfiles/rails_3_2.gemfile
12
12
  - gemfiles/rails_4_0.gemfile
13
13
  - gemfiles/rails_4_1.gemfile
14
14
  - gemfiles/rails_4_2.gemfile
15
+ - gemfiles/rails_5_0.gemfile
15
16
  script: "bundle exec rake"
16
17
  notifications:
17
18
  recipients:
data/Gemfile CHANGED
@@ -2,7 +2,9 @@ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- gem "rails"
5
+ gem "activerecord"
6
+ gem "actionpack"
7
+ gem "railties"
6
8
  gem "rspec-rails"
7
9
  gem "test-unit"
8
10
  gem "sqlite3"
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lol_dba (2.1.1)
4
+ lol_dba (2.1.2)
5
5
  actionpack (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  railties (>= 3.0)
@@ -9,39 +9,26 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.0.0.1)
13
- actionpack (= 5.0.0.1)
14
- nio4r (~> 1.2)
15
- websocket-driver (~> 0.6.1)
16
- actionmailer (5.0.0.1)
17
- actionpack (= 5.0.0.1)
18
- actionview (= 5.0.0.1)
19
- activejob (= 5.0.0.1)
20
- mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 2.0)
22
- actionpack (5.0.0.1)
23
- actionview (= 5.0.0.1)
24
- activesupport (= 5.0.0.1)
12
+ actionpack (5.0.2)
13
+ actionview (= 5.0.2)
14
+ activesupport (= 5.0.2)
25
15
  rack (~> 2.0)
26
16
  rack-test (~> 0.6.3)
27
17
  rails-dom-testing (~> 2.0)
28
18
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.0.0.1)
30
- activesupport (= 5.0.0.1)
19
+ actionview (5.0.2)
20
+ activesupport (= 5.0.2)
31
21
  builder (~> 3.1)
32
22
  erubis (~> 2.7.0)
33
23
  rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
35
- activejob (5.0.0.1)
36
- activesupport (= 5.0.0.1)
37
- globalid (>= 0.3.6)
38
- activemodel (5.0.0.1)
39
- activesupport (= 5.0.0.1)
40
- activerecord (5.0.0.1)
41
- activemodel (= 5.0.0.1)
42
- activesupport (= 5.0.0.1)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
25
+ activemodel (5.0.2)
26
+ activesupport (= 5.0.2)
27
+ activerecord (5.0.2)
28
+ activemodel (= 5.0.2)
29
+ activesupport (= 5.0.2)
43
30
  arel (~> 7.0)
44
- activesupport (5.0.0.1)
31
+ activesupport (5.0.2)
45
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
33
  i18n (~> 0.7)
47
34
  minitest (~> 5.1)
@@ -50,55 +37,35 @@ GEM
50
37
  bundler
51
38
  rake
52
39
  thor (>= 0.14.0)
53
- arel (7.1.3)
54
- builder (3.2.2)
55
- concurrent-ruby (1.0.2)
56
- diff-lcs (1.2.5)
40
+ arel (7.1.4)
41
+ builder (3.2.3)
42
+ concurrent-ruby (1.0.5)
43
+ diff-lcs (1.3)
57
44
  erubis (2.7.0)
58
- globalid (0.3.7)
59
- activesupport (>= 4.1.0)
60
- i18n (0.7.0)
45
+ i18n (0.8.1)
61
46
  loofah (2.0.3)
62
47
  nokogiri (>= 1.5.9)
63
- mail (2.6.4)
64
- mime-types (>= 1.16, < 4)
65
48
  method_source (0.8.2)
66
- mime-types (3.1)
67
- mime-types-data (~> 3.2015)
68
- mime-types-data (3.2016.0521)
69
49
  mini_portile2 (2.1.0)
70
- minitest (5.9.1)
71
- nio4r (1.2.1)
72
- nokogiri (1.6.8.1)
50
+ minitest (5.10.1)
51
+ nokogiri (1.7.1)
73
52
  mini_portile2 (~> 2.1.0)
74
- power_assert (0.3.1)
53
+ power_assert (1.0.1)
75
54
  rack (2.0.1)
76
55
  rack-test (0.6.3)
77
56
  rack (>= 1.0)
78
- rails (5.0.0.1)
79
- actioncable (= 5.0.0.1)
80
- actionmailer (= 5.0.0.1)
81
- actionpack (= 5.0.0.1)
82
- actionview (= 5.0.0.1)
83
- activejob (= 5.0.0.1)
84
- activemodel (= 5.0.0.1)
85
- activerecord (= 5.0.0.1)
86
- activesupport (= 5.0.0.1)
87
- bundler (>= 1.3.0, < 2.0)
88
- railties (= 5.0.0.1)
89
- sprockets-rails (>= 2.0.0)
90
- rails-dom-testing (2.0.1)
57
+ rails-dom-testing (2.0.2)
91
58
  activesupport (>= 4.2.0, < 6.0)
92
- nokogiri (~> 1.6.0)
59
+ nokogiri (~> 1.6)
93
60
  rails-html-sanitizer (1.0.3)
94
61
  loofah (~> 2.0)
95
- railties (5.0.0.1)
96
- actionpack (= 5.0.0.1)
97
- activesupport (= 5.0.0.1)
62
+ railties (5.0.2)
63
+ actionpack (= 5.0.2)
64
+ activesupport (= 5.0.2)
98
65
  method_source
99
66
  rake (>= 0.8.7)
100
67
  thor (>= 0.18.1, < 2.0)
101
- rake (11.3.0)
68
+ rake (12.0.0)
102
69
  rspec-core (3.5.4)
103
70
  rspec-support (~> 3.5.0)
104
71
  rspec-expectations (3.5.0)
@@ -116,34 +83,26 @@ GEM
116
83
  rspec-mocks (~> 3.5.0)
117
84
  rspec-support (~> 3.5.0)
118
85
  rspec-support (3.5.0)
119
- sprockets (3.7.0)
120
- concurrent-ruby (~> 1.0)
121
- rack (> 1, < 3)
122
- sprockets-rails (3.2.0)
123
- actionpack (>= 4.0)
124
- activesupport (>= 4.0)
125
- sprockets (>= 3.0.0)
126
- sqlite3 (1.3.12)
127
- test-unit (3.2.1)
86
+ sqlite3 (1.3.13)
87
+ test-unit (3.2.3)
128
88
  power_assert
129
- thor (0.19.1)
130
- thread_safe (0.3.5)
131
- tzinfo (1.2.2)
89
+ thor (0.19.4)
90
+ thread_safe (0.3.6)
91
+ tzinfo (1.2.3)
132
92
  thread_safe (~> 0.1)
133
- websocket-driver (0.6.4)
134
- websocket-extensions (>= 0.1.0)
135
- websocket-extensions (0.1.2)
136
93
 
137
94
  PLATFORMS
138
95
  ruby
139
96
 
140
97
  DEPENDENCIES
98
+ actionpack
99
+ activerecord
141
100
  appraisal (~> 1.0)
142
101
  lol_dba!
143
- rails
102
+ railties
144
103
  rspec-rails
145
104
  sqlite3
146
105
  test-unit
147
106
 
148
107
  BUNDLED WITH
149
- 1.12.3
108
+ 1.14.3
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- #lol_dba [![travis](https://api.travis-ci.org/plentz/lol_dba.png?branch=master)](https://travis-ci.org/plentz/lol_dba)
1
+ # lol_dba [![travis](https://api.travis-ci.org/plentz/lol_dba.png?branch=master)](https://travis-ci.org/plentz/lol_dba)
2
2
 
3
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. 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).
4
4
 
@@ -45,7 +45,7 @@ Compatible with Ruby 2.x and Rails 3.x, 4.x, 5.x.
45
45
 
46
46
  ### About primary_key
47
47
 
48
- >The primary key is always indexed. This is generally true for all storage engines that at all supports indices.
48
+ >The primary key is always indexed. This is generally true for all storage engines that at all supports indexes.
49
49
 
50
50
  For this reason, we no longer suggest to add indexes to primary keys.
51
51
 
@@ -55,32 +55,6 @@ To run lol_dba tests, just clone the repo and run:
55
55
 
56
56
  bundle install && rake
57
57
 
58
- ### Feedback
59
-
60
- All feedback, bug reports and thoughts on this gratefully received.
61
-
62
- ### Contributors
63
-
64
- * [Diego Plentz](http://plentz.org)
65
- * [Elad Meidar](http://blog.eizesus.com)
66
- * [Eric Davis](http://littlestreamsoftware.com)
67
- * [Jay Fields](http://jayfields.com/)
68
- * [Muness Alrubaie](http://muness.blogspot.com/)
69
- * [Vladimir Sharshov](https://github.com/warpc)
70
- * [Fabio Rehm](http://fabiorehm.com/)
71
- * [Emanuel Imhof](http://m43nu.ch)
72
- * [Adrian Hooper](https://twitter.com/PaReeOhNos)
73
- * [Ray Zane](https://github.com/rzane)
74
- * [Grant Gongaware](https://github.com/ggongaware)
75
- * [Przemysław “Szeryf” Kowalczyk](https://szeryf.wordpress.com)
76
- * [Philipp Weissensteiner](http://philippweissensteiner.com)
77
- * [Leung Ho Kuen](https://twitter.com/PikachuEXE)
78
- * [Lucas Mazza](https://twitter.com/lucasmazza)
79
- * [Larry Reaves](https://github.com/yrral86)
80
- * [James Bowles](https://github.com/jamesbowles)
81
- * [Anderson Pierre Cardoso](https://github.com/andersoncardoso)
82
- * [James Bowler](https://github.com/jamesbowles)
83
-
84
58
  ### License
85
59
 
86
60
  Lol DBA is released under the MIT license.
@@ -2,12 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails"
6
- gem "rspec-rails"
7
- gem "test-unit"
8
- gem "sqlite3"
9
5
  gem "activerecord", "~> 3.2.21"
10
6
  gem "actionpack", "~> 3.2.21"
11
7
  gem "railties", "~> 3.2.21"
8
+ gem "rspec-rails"
9
+ gem "test-unit"
10
+ gem "sqlite3"
12
11
 
13
12
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- lol_dba (2.1.1)
4
+ lol_dba (2.1.2)
5
5
  actionpack (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  railties (>= 3.0)
@@ -9,9 +9,6 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (3.2.22.5)
13
- actionpack (= 3.2.22.5)
14
- mail (~> 2.5.4)
15
12
  actionpack (3.2.22.5)
16
13
  activemodel (= 3.2.22.5)
17
14
  activesupport (= 3.2.22.5)
@@ -30,9 +27,6 @@ GEM
30
27
  activesupport (= 3.2.22.5)
31
28
  arel (~> 3.0.2)
32
29
  tzinfo (~> 0.3.29)
33
- activeresource (3.2.22.5)
34
- activemodel (= 3.2.22.5)
35
- activesupport (= 3.2.22.5)
36
30
  activesupport (3.2.22.5)
37
31
  i18n (~> 0.6, >= 0.6.4)
38
32
  multi_json (~> 1.0)
@@ -42,34 +36,21 @@ GEM
42
36
  thor (>= 0.14.0)
43
37
  arel (3.0.3)
44
38
  builder (3.0.4)
45
- diff-lcs (1.2.5)
39
+ diff-lcs (1.3)
46
40
  erubis (2.7.0)
47
41
  hike (1.2.3)
48
- i18n (0.7.0)
42
+ i18n (0.8.1)
49
43
  journey (1.0.4)
50
- json (1.8.3)
51
- mail (2.5.4)
52
- mime-types (~> 1.16)
53
- treetop (~> 1.4.8)
54
- mime-types (1.25.1)
44
+ json (1.8.6)
55
45
  multi_json (1.12.1)
56
- polyglot (0.3.5)
57
- power_assert (0.3.1)
46
+ power_assert (1.0.1)
58
47
  rack (1.4.7)
59
- rack-cache (1.6.1)
48
+ rack-cache (1.7.0)
60
49
  rack (>= 0.4)
61
50
  rack-ssl (1.3.4)
62
51
  rack
63
52
  rack-test (0.6.3)
64
53
  rack (>= 1.0)
65
- rails (3.2.22.5)
66
- actionmailer (= 3.2.22.5)
67
- actionpack (= 3.2.22.5)
68
- activerecord (= 3.2.22.5)
69
- activeresource (= 3.2.22.5)
70
- activesupport (= 3.2.22.5)
71
- bundler (~> 1.0)
72
- railties (= 3.2.22.5)
73
54
  railties (3.2.22.5)
74
55
  actionpack (= 3.2.22.5)
75
56
  activesupport (= 3.2.22.5)
@@ -77,7 +58,7 @@ GEM
77
58
  rake (>= 0.8.7)
78
59
  rdoc (~> 3.4)
79
60
  thor (>= 0.14.6, < 2.0)
80
- rake (11.3.0)
61
+ rake (12.0.0)
81
62
  rdoc (3.12.2)
82
63
  json (~> 1.4)
83
64
  rspec-core (3.5.4)
@@ -102,15 +83,12 @@ GEM
102
83
  multi_json (~> 1.0)
103
84
  rack (~> 1.0)
104
85
  tilt (~> 1.1, != 1.3.0)
105
- sqlite3 (1.3.12)
106
- test-unit (3.2.1)
86
+ sqlite3 (1.3.13)
87
+ test-unit (3.2.3)
107
88
  power_assert
108
- thor (0.19.1)
89
+ thor (0.19.4)
109
90
  tilt (1.4.1)
110
- treetop (1.4.15)
111
- polyglot
112
- polyglot (>= 0.3.1)
113
- tzinfo (0.3.51)
91
+ tzinfo (0.3.53)
114
92
 
115
93
  PLATFORMS
116
94
  ruby
@@ -120,11 +98,10 @@ DEPENDENCIES
120
98
  activerecord (~> 3.2.21)
121
99
  appraisal (~> 1.0)
122
100
  lol_dba!
123
- rails
124
101
  railties (~> 3.2.21)
125
102
  rspec-rails
126
103
  sqlite3
127
104
  test-unit
128
105
 
129
106
  BUNDLED WITH
130
- 1.12.3
107
+ 1.14.3
@@ -2,12 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails"
6
- gem "rspec-rails"
7
- gem "test-unit"
8
- gem "sqlite3"
9
5
  gem "activerecord", "~> 4.0.13"
10
6
  gem "actionpack", "~> 4.0.13"
11
7
  gem "railties", "~> 4.0.13"
8
+ gem "rspec-rails"
9
+ gem "test-unit"
10
+ gem "sqlite3"
12
11
 
13
12
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- lol_dba (2.1.1)
4
+ lol_dba (2.1.2)
5
5
  actionpack (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  railties (>= 3.0)
@@ -9,9 +9,6 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (4.0.13)
13
- actionpack (= 4.0.13)
14
- mail (~> 2.5, >= 2.5.4)
15
12
  actionpack (4.0.13)
16
13
  activesupport (= 4.0.13)
17
14
  builder (~> 3.1.0)
@@ -39,35 +36,21 @@ GEM
39
36
  thor (>= 0.14.0)
40
37
  arel (4.0.2)
41
38
  builder (3.1.4)
42
- concurrent-ruby (1.0.2)
43
- diff-lcs (1.2.5)
39
+ diff-lcs (1.3)
44
40
  erubis (2.7.0)
45
- i18n (0.7.0)
46
- mail (2.6.4)
47
- mime-types (>= 1.16, < 4)
48
- mime-types (3.1)
49
- mime-types-data (~> 3.2015)
50
- mime-types-data (3.2016.0521)
41
+ i18n (0.8.1)
51
42
  minitest (4.7.5)
52
43
  multi_json (1.12.1)
53
- power_assert (0.3.1)
44
+ power_assert (1.0.1)
54
45
  rack (1.5.5)
55
46
  rack-test (0.6.3)
56
47
  rack (>= 1.0)
57
- rails (4.0.13)
58
- actionmailer (= 4.0.13)
59
- actionpack (= 4.0.13)
60
- activerecord (= 4.0.13)
61
- activesupport (= 4.0.13)
62
- bundler (>= 1.3.0, < 2.0)
63
- railties (= 4.0.13)
64
- sprockets-rails (~> 2.0)
65
48
  railties (4.0.13)
66
49
  actionpack (= 4.0.13)
67
50
  activesupport (= 4.0.13)
68
51
  rake (>= 0.8.7)
69
52
  thor (>= 0.18.1, < 2.0)
70
- rake (11.3.0)
53
+ rake (12.0.0)
71
54
  rspec-core (3.5.4)
72
55
  rspec-support (~> 3.5.0)
73
56
  rspec-expectations (3.5.0)
@@ -85,19 +68,12 @@ GEM
85
68
  rspec-mocks (~> 3.5.0)
86
69
  rspec-support (~> 3.5.0)
87
70
  rspec-support (3.5.0)
88
- sprockets (3.7.0)
89
- concurrent-ruby (~> 1.0)
90
- rack (> 1, < 3)
91
- sprockets-rails (2.3.3)
92
- actionpack (>= 3.0)
93
- activesupport (>= 3.0)
94
- sprockets (>= 2.8, < 4.0)
95
- sqlite3 (1.3.12)
96
- test-unit (3.2.1)
71
+ sqlite3 (1.3.13)
72
+ test-unit (3.2.3)
97
73
  power_assert
98
- thor (0.19.1)
99
- thread_safe (0.3.5)
100
- tzinfo (0.3.51)
74
+ thor (0.19.4)
75
+ thread_safe (0.3.6)
76
+ tzinfo (0.3.53)
101
77
 
102
78
  PLATFORMS
103
79
  ruby
@@ -107,11 +83,10 @@ DEPENDENCIES
107
83
  activerecord (~> 4.0.13)
108
84
  appraisal (~> 1.0)
109
85
  lol_dba!
110
- rails
111
86
  railties (~> 4.0.13)
112
87
  rspec-rails
113
88
  sqlite3
114
89
  test-unit
115
90
 
116
91
  BUNDLED WITH
117
- 1.12.3
92
+ 1.14.3
@@ -2,12 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails"
6
- gem "rspec-rails"
7
- gem "test-unit"
8
- gem "sqlite3"
9
5
  gem "activerecord", "~> 4.1.9"
10
6
  gem "actionpack", "~> 4.1.9"
11
7
  gem "railties", "~> 4.1.9"
8
+ gem "rspec-rails"
9
+ gem "test-unit"
10
+ gem "sqlite3"
12
11
 
13
12
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- lol_dba (2.1.1)
4
+ lol_dba (2.1.2)
5
5
  actionpack (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  railties (>= 3.0)
@@ -9,10 +9,6 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (4.1.16)
13
- actionpack (= 4.1.16)
14
- actionview (= 4.1.16)
15
- mail (~> 2.5, >= 2.5.4)
16
12
  actionpack (4.1.16)
17
13
  actionview (= 4.1.16)
18
14
  activesupport (= 4.1.16)
@@ -40,38 +36,22 @@ GEM
40
36
  rake
41
37
  thor (>= 0.14.0)
42
38
  arel (5.0.1.20140414130214)
43
- builder (3.2.2)
44
- concurrent-ruby (1.0.2)
45
- diff-lcs (1.2.5)
39
+ builder (3.2.3)
40
+ diff-lcs (1.3)
46
41
  erubis (2.7.0)
47
- i18n (0.7.0)
48
- json (1.8.3)
49
- mail (2.6.4)
50
- mime-types (>= 1.16, < 4)
51
- mime-types (3.1)
52
- mime-types-data (~> 3.2015)
53
- mime-types-data (3.2016.0521)
54
- minitest (5.9.1)
55
- power_assert (0.3.1)
42
+ i18n (0.8.1)
43
+ json (1.8.6)
44
+ minitest (5.10.1)
45
+ power_assert (1.0.1)
56
46
  rack (1.5.5)
57
47
  rack-test (0.6.3)
58
48
  rack (>= 1.0)
59
- rails (4.1.16)
60
- actionmailer (= 4.1.16)
61
- actionpack (= 4.1.16)
62
- actionview (= 4.1.16)
63
- activemodel (= 4.1.16)
64
- activerecord (= 4.1.16)
65
- activesupport (= 4.1.16)
66
- bundler (>= 1.3.0, < 2.0)
67
- railties (= 4.1.16)
68
- sprockets-rails (~> 2.0)
69
49
  railties (4.1.16)
70
50
  actionpack (= 4.1.16)
71
51
  activesupport (= 4.1.16)
72
52
  rake (>= 0.8.7)
73
53
  thor (>= 0.18.1, < 2.0)
74
- rake (11.3.0)
54
+ rake (12.0.0)
75
55
  rspec-core (3.5.4)
76
56
  rspec-support (~> 3.5.0)
77
57
  rspec-expectations (3.5.0)
@@ -89,19 +69,12 @@ GEM
89
69
  rspec-mocks (~> 3.5.0)
90
70
  rspec-support (~> 3.5.0)
91
71
  rspec-support (3.5.0)
92
- sprockets (3.7.0)
93
- concurrent-ruby (~> 1.0)
94
- rack (> 1, < 3)
95
- sprockets-rails (2.3.3)
96
- actionpack (>= 3.0)
97
- activesupport (>= 3.0)
98
- sprockets (>= 2.8, < 4.0)
99
- sqlite3 (1.3.12)
100
- test-unit (3.2.1)
72
+ sqlite3 (1.3.13)
73
+ test-unit (3.2.3)
101
74
  power_assert
102
- thor (0.19.1)
103
- thread_safe (0.3.5)
104
- tzinfo (1.2.2)
75
+ thor (0.19.4)
76
+ thread_safe (0.3.6)
77
+ tzinfo (1.2.3)
105
78
  thread_safe (~> 0.1)
106
79
 
107
80
  PLATFORMS
@@ -112,11 +85,10 @@ DEPENDENCIES
112
85
  activerecord (~> 4.1.9)
113
86
  appraisal (~> 1.0)
114
87
  lol_dba!
115
- rails
116
88
  railties (~> 4.1.9)
117
89
  rspec-rails
118
90
  sqlite3
119
91
  test-unit
120
92
 
121
93
  BUNDLED WITH
122
- 1.12.3
94
+ 1.14.3
@@ -2,12 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails"
6
- gem "rspec-rails"
7
- gem "test-unit"
8
- gem "sqlite3"
9
5
  gem "activerecord", "~> 4.2.0"
10
6
  gem "actionpack", "~> 4.2.0"
11
7
  gem "railties", "~> 4.2.0"
8
+ gem "rspec-rails"
9
+ gem "test-unit"
10
+ gem "sqlite3"
12
11
 
13
12
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- lol_dba (2.1.1)
4
+ lol_dba (2.1.2)
5
5
  actionpack (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  railties (>= 3.0)
@@ -9,38 +9,28 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actionmailer (4.2.7.1)
13
- actionpack (= 4.2.7.1)
14
- actionview (= 4.2.7.1)
15
- activejob (= 4.2.7.1)
16
- mail (~> 2.5, >= 2.5.4)
17
- rails-dom-testing (~> 1.0, >= 1.0.5)
18
- actionpack (4.2.7.1)
19
- actionview (= 4.2.7.1)
20
- activesupport (= 4.2.7.1)
12
+ actionpack (4.2.8)
13
+ actionview (= 4.2.8)
14
+ activesupport (= 4.2.8)
21
15
  rack (~> 1.6)
22
16
  rack-test (~> 0.6.2)
23
17
  rails-dom-testing (~> 1.0, >= 1.0.5)
24
18
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
25
- actionview (4.2.7.1)
26
- activesupport (= 4.2.7.1)
19
+ actionview (4.2.8)
20
+ activesupport (= 4.2.8)
27
21
  builder (~> 3.1)
28
22
  erubis (~> 2.7.0)
29
23
  rails-dom-testing (~> 1.0, >= 1.0.5)
30
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
31
- activejob (4.2.7.1)
32
- activesupport (= 4.2.7.1)
33
- globalid (>= 0.3.0)
34
- activemodel (4.2.7.1)
35
- activesupport (= 4.2.7.1)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
25
+ activemodel (4.2.8)
26
+ activesupport (= 4.2.8)
36
27
  builder (~> 3.1)
37
- activerecord (4.2.7.1)
38
- activemodel (= 4.2.7.1)
39
- activesupport (= 4.2.7.1)
28
+ activerecord (4.2.8)
29
+ activemodel (= 4.2.8)
30
+ activesupport (= 4.2.8)
40
31
  arel (~> 6.0)
41
- activesupport (4.2.7.1)
32
+ activesupport (4.2.8)
42
33
  i18n (~> 0.7)
43
- json (~> 1.7, >= 1.7.7)
44
34
  minitest (~> 5.1)
45
35
  thread_safe (~> 0.3, >= 0.3.4)
46
36
  tzinfo (~> 1.1)
@@ -48,55 +38,35 @@ GEM
48
38
  bundler
49
39
  rake
50
40
  thor (>= 0.14.0)
51
- arel (6.0.3)
52
- builder (3.2.2)
53
- concurrent-ruby (1.0.2)
54
- diff-lcs (1.2.5)
41
+ arel (6.0.4)
42
+ builder (3.2.3)
43
+ diff-lcs (1.3)
55
44
  erubis (2.7.0)
56
- globalid (0.3.7)
57
- activesupport (>= 4.1.0)
58
- i18n (0.7.0)
59
- json (1.8.3)
45
+ i18n (0.8.1)
60
46
  loofah (2.0.3)
61
47
  nokogiri (>= 1.5.9)
62
- mail (2.6.4)
63
- mime-types (>= 1.16, < 4)
64
- mime-types (3.1)
65
- mime-types-data (~> 3.2015)
66
- mime-types-data (3.2016.0521)
67
48
  mini_portile2 (2.1.0)
68
- minitest (5.9.1)
69
- nokogiri (1.6.8.1)
49
+ minitest (5.10.1)
50
+ nokogiri (1.7.1)
70
51
  mini_portile2 (~> 2.1.0)
71
- power_assert (0.3.1)
72
- rack (1.6.4)
52
+ power_assert (1.0.1)
53
+ rack (1.6.5)
73
54
  rack-test (0.6.3)
74
55
  rack (>= 1.0)
75
- rails (4.2.7.1)
76
- actionmailer (= 4.2.7.1)
77
- actionpack (= 4.2.7.1)
78
- actionview (= 4.2.7.1)
79
- activejob (= 4.2.7.1)
80
- activemodel (= 4.2.7.1)
81
- activerecord (= 4.2.7.1)
82
- activesupport (= 4.2.7.1)
83
- bundler (>= 1.3.0, < 2.0)
84
- railties (= 4.2.7.1)
85
- sprockets-rails
86
56
  rails-deprecated_sanitizer (1.0.3)
87
57
  activesupport (>= 4.2.0.alpha)
88
- rails-dom-testing (1.0.7)
58
+ rails-dom-testing (1.0.8)
89
59
  activesupport (>= 4.2.0.beta, < 5.0)
90
- nokogiri (~> 1.6.0)
60
+ nokogiri (~> 1.6)
91
61
  rails-deprecated_sanitizer (>= 1.0.1)
92
62
  rails-html-sanitizer (1.0.3)
93
63
  loofah (~> 2.0)
94
- railties (4.2.7.1)
95
- actionpack (= 4.2.7.1)
96
- activesupport (= 4.2.7.1)
64
+ railties (4.2.8)
65
+ actionpack (= 4.2.8)
66
+ activesupport (= 4.2.8)
97
67
  rake (>= 0.8.7)
98
68
  thor (>= 0.18.1, < 2.0)
99
- rake (11.3.0)
69
+ rake (12.0.0)
100
70
  rspec-core (3.5.4)
101
71
  rspec-support (~> 3.5.0)
102
72
  rspec-expectations (3.5.0)
@@ -114,19 +84,12 @@ GEM
114
84
  rspec-mocks (~> 3.5.0)
115
85
  rspec-support (~> 3.5.0)
116
86
  rspec-support (3.5.0)
117
- sprockets (3.7.0)
118
- concurrent-ruby (~> 1.0)
119
- rack (> 1, < 3)
120
- sprockets-rails (3.2.0)
121
- actionpack (>= 4.0)
122
- activesupport (>= 4.0)
123
- sprockets (>= 3.0.0)
124
- sqlite3 (1.3.12)
125
- test-unit (3.2.1)
87
+ sqlite3 (1.3.13)
88
+ test-unit (3.2.3)
126
89
  power_assert
127
- thor (0.19.1)
128
- thread_safe (0.3.5)
129
- tzinfo (1.2.2)
90
+ thor (0.19.4)
91
+ thread_safe (0.3.6)
92
+ tzinfo (1.2.3)
130
93
  thread_safe (~> 0.1)
131
94
 
132
95
  PLATFORMS
@@ -137,11 +100,10 @@ DEPENDENCIES
137
100
  activerecord (~> 4.2.0)
138
101
  appraisal (~> 1.0)
139
102
  lol_dba!
140
- rails
141
103
  railties (~> 4.2.0)
142
104
  rspec-rails
143
105
  sqlite3
144
106
  test-unit
145
107
 
146
108
  BUNDLED WITH
147
- 1.12.3
109
+ 1.14.3
@@ -2,12 +2,11 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails"
6
- gem "rspec-rails"
7
- gem "test-unit"
8
- gem "sqlite3"
9
5
  gem "activerecord", "~> 5.0"
10
6
  gem "actionpack", "~> 5.0"
11
7
  gem "railties", "~> 5.0"
8
+ gem "rspec-rails"
9
+ gem "test-unit"
10
+ gem "sqlite3"
12
11
 
13
12
  gemspec :path => "../"
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ../
2
+ remote: ..
3
3
  specs:
4
- lol_dba (2.1.1)
4
+ lol_dba (2.1.2)
5
5
  actionpack (>= 3.0)
6
6
  activerecord (>= 3.0)
7
7
  railties (>= 3.0)
@@ -9,39 +9,26 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- actioncable (5.0.0.1)
13
- actionpack (= 5.0.0.1)
14
- nio4r (~> 1.2)
15
- websocket-driver (~> 0.6.1)
16
- actionmailer (5.0.0.1)
17
- actionpack (= 5.0.0.1)
18
- actionview (= 5.0.0.1)
19
- activejob (= 5.0.0.1)
20
- mail (~> 2.5, >= 2.5.4)
21
- rails-dom-testing (~> 2.0)
22
- actionpack (5.0.0.1)
23
- actionview (= 5.0.0.1)
24
- activesupport (= 5.0.0.1)
12
+ actionpack (5.0.2)
13
+ actionview (= 5.0.2)
14
+ activesupport (= 5.0.2)
25
15
  rack (~> 2.0)
26
16
  rack-test (~> 0.6.3)
27
17
  rails-dom-testing (~> 2.0)
28
18
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
- actionview (5.0.0.1)
30
- activesupport (= 5.0.0.1)
19
+ actionview (5.0.2)
20
+ activesupport (= 5.0.2)
31
21
  builder (~> 3.1)
32
22
  erubis (~> 2.7.0)
33
23
  rails-dom-testing (~> 2.0)
34
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
35
- activejob (5.0.0.1)
36
- activesupport (= 5.0.0.1)
37
- globalid (>= 0.3.6)
38
- activemodel (5.0.0.1)
39
- activesupport (= 5.0.0.1)
40
- activerecord (5.0.0.1)
41
- activemodel (= 5.0.0.1)
42
- activesupport (= 5.0.0.1)
24
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
25
+ activemodel (5.0.2)
26
+ activesupport (= 5.0.2)
27
+ activerecord (5.0.2)
28
+ activemodel (= 5.0.2)
29
+ activesupport (= 5.0.2)
43
30
  arel (~> 7.0)
44
- activesupport (5.0.0.1)
31
+ activesupport (5.0.2)
45
32
  concurrent-ruby (~> 1.0, >= 1.0.2)
46
33
  i18n (~> 0.7)
47
34
  minitest (~> 5.1)
@@ -50,55 +37,35 @@ GEM
50
37
  bundler
51
38
  rake
52
39
  thor (>= 0.14.0)
53
- arel (7.1.3)
54
- builder (3.2.2)
55
- concurrent-ruby (1.0.2)
56
- diff-lcs (1.2.5)
40
+ arel (7.1.4)
41
+ builder (3.2.3)
42
+ concurrent-ruby (1.0.5)
43
+ diff-lcs (1.3)
57
44
  erubis (2.7.0)
58
- globalid (0.3.7)
59
- activesupport (>= 4.1.0)
60
- i18n (0.7.0)
45
+ i18n (0.8.1)
61
46
  loofah (2.0.3)
62
47
  nokogiri (>= 1.5.9)
63
- mail (2.6.4)
64
- mime-types (>= 1.16, < 4)
65
48
  method_source (0.8.2)
66
- mime-types (3.1)
67
- mime-types-data (~> 3.2015)
68
- mime-types-data (3.2016.0521)
69
49
  mini_portile2 (2.1.0)
70
- minitest (5.9.1)
71
- nio4r (1.2.1)
72
- nokogiri (1.6.8.1)
50
+ minitest (5.10.1)
51
+ nokogiri (1.7.1)
73
52
  mini_portile2 (~> 2.1.0)
74
- power_assert (0.3.1)
53
+ power_assert (1.0.1)
75
54
  rack (2.0.1)
76
55
  rack-test (0.6.3)
77
56
  rack (>= 1.0)
78
- rails (5.0.0.1)
79
- actioncable (= 5.0.0.1)
80
- actionmailer (= 5.0.0.1)
81
- actionpack (= 5.0.0.1)
82
- actionview (= 5.0.0.1)
83
- activejob (= 5.0.0.1)
84
- activemodel (= 5.0.0.1)
85
- activerecord (= 5.0.0.1)
86
- activesupport (= 5.0.0.1)
87
- bundler (>= 1.3.0, < 2.0)
88
- railties (= 5.0.0.1)
89
- sprockets-rails (>= 2.0.0)
90
- rails-dom-testing (2.0.1)
57
+ rails-dom-testing (2.0.2)
91
58
  activesupport (>= 4.2.0, < 6.0)
92
- nokogiri (~> 1.6.0)
59
+ nokogiri (~> 1.6)
93
60
  rails-html-sanitizer (1.0.3)
94
61
  loofah (~> 2.0)
95
- railties (5.0.0.1)
96
- actionpack (= 5.0.0.1)
97
- activesupport (= 5.0.0.1)
62
+ railties (5.0.2)
63
+ actionpack (= 5.0.2)
64
+ activesupport (= 5.0.2)
98
65
  method_source
99
66
  rake (>= 0.8.7)
100
67
  thor (>= 0.18.1, < 2.0)
101
- rake (11.3.0)
68
+ rake (12.0.0)
102
69
  rspec-core (3.5.4)
103
70
  rspec-support (~> 3.5.0)
104
71
  rspec-expectations (3.5.0)
@@ -116,23 +83,13 @@ GEM
116
83
  rspec-mocks (~> 3.5.0)
117
84
  rspec-support (~> 3.5.0)
118
85
  rspec-support (3.5.0)
119
- sprockets (3.7.0)
120
- concurrent-ruby (~> 1.0)
121
- rack (> 1, < 3)
122
- sprockets-rails (3.2.0)
123
- actionpack (>= 4.0)
124
- activesupport (>= 4.0)
125
- sprockets (>= 3.0.0)
126
- sqlite3 (1.3.12)
127
- test-unit (3.2.1)
86
+ sqlite3 (1.3.13)
87
+ test-unit (3.2.3)
128
88
  power_assert
129
- thor (0.19.1)
130
- thread_safe (0.3.5)
131
- tzinfo (1.2.2)
89
+ thor (0.19.4)
90
+ thread_safe (0.3.6)
91
+ tzinfo (1.2.3)
132
92
  thread_safe (~> 0.1)
133
- websocket-driver (0.6.4)
134
- websocket-extensions (>= 0.1.0)
135
- websocket-extensions (0.1.2)
136
93
 
137
94
  PLATFORMS
138
95
  ruby
@@ -142,11 +99,10 @@ DEPENDENCIES
142
99
  activerecord (~> 5.0)
143
100
  appraisal (~> 1.0)
144
101
  lol_dba!
145
- rails
146
102
  railties (~> 5.0)
147
103
  rspec-rails
148
104
  sqlite3
149
105
  test-unit
150
106
 
151
107
  BUNDLED WITH
152
- 1.12.3
108
+ 1.14.3
@@ -6,12 +6,12 @@ module LolDba
6
6
 
7
7
  def self.form_migration_content(migration_name, index_array)
8
8
  migration = <<EOM
9
- * run `rails g migration AddMissingIndexes` and add the following content:
9
+ * run `rails g migration #{migration_name}` and add the following content:
10
10
 
11
11
 
12
12
  class #{migration_name} < ActiveRecord::Migration
13
13
  def change
14
- #{index_array.uniq.join("\n ")}
14
+ #{index_array.sort.uniq.join("\n ")}
15
15
  end
16
16
  end
17
17
  EOM
@@ -119,20 +119,22 @@ EOM
119
119
  foreign_key = get_through_foreign_key(class_name, reflection_options)
120
120
  index_name = [association_foreign_key, foreign_key].map(&:to_s).sort
121
121
  when :has_many
122
- # has_many tables are threaten by the other side of the relation
123
- next unless reflection_options.options[:through] && reflections[reflection_options.options[:through].to_s]
124
- through_class = reflections[reflection_options.options[:through].to_s].klass
122
+ through = reflection_options.options[:through]
123
+ next unless through && reflections[through.to_s] # has_many tables are threaten by the other side of the relation
124
+
125
+ through_class = reflections[through.to_s].klass
125
126
  table_name = through_class.table_name
126
127
 
127
128
  foreign_key = get_through_foreign_key(class_name, reflection_options)
128
129
 
130
+ through_reflections = through_class.reflections.stringify_keys
129
131
  if source = reflection_options.options[:source]
130
- association_reflection = through_class.reflections.stringify_keys[source.to_s]
132
+ association_reflection = through_reflections[source.to_s]
131
133
  next if association_reflection.options[:polymorphic]
132
134
  association_foreign_key = get_through_foreign_key(association_reflection.klass, reflection_options)
133
- elsif through_reflections = through_class.reflections.stringify_keys[reflection_name.singularize]
135
+ elsif belongs_to_reflections = through_reflections[reflection_name.singularize]
134
136
  # go to joining model through has_many and find belongs_to
135
- association_foreign_key = through_reflections.options[:foreign_key]
137
+ association_foreign_key = belongs_to_reflections.options[:foreign_key]
136
138
  end
137
139
 
138
140
  #FIXME currently we don't support :through => :another_regular_has_many_and_non_through_relation
@@ -169,13 +171,13 @@ EOM
169
171
 
170
172
  def self.puts_migration_content(migration_name, indexes, warning_messages)
171
173
  puts warning_messages
172
- if indexes.keys.empty?
174
+ add = form_data_for_migration(indexes)
175
+ if add.blank?
173
176
  puts "Yey, no missing indexes found!"
174
177
  else
175
178
  tip = "* TIP: if you have a problem with the index name('index name too long') you can solve with the :name option. "
176
179
  tip += "Something like :name => 'my_index'."
177
180
  puts tip
178
- add = form_data_for_migration(indexes)
179
181
  puts form_migration_content(migration_name, add)
180
182
  end
181
183
  end
@@ -56,7 +56,7 @@ module LolDba
56
56
 
57
57
  def migrations(which)
58
58
  migrator = nil
59
- if ActiveRecord.version.version =~ /^4./
59
+ if ::ActiveRecord::VERSION::MAJOR =~ /^4./
60
60
  migrator = ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_path))
61
61
  else
62
62
  migrator = ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations_path)
@@ -93,4 +93,4 @@ module LolDba
93
93
  end
94
94
  end
95
95
  end
96
- end
96
+ end
@@ -1,3 +1,3 @@
1
1
  module LolDba
2
- VERSION = "2.1.1" unless defined? LolDba::VERSION
2
+ VERSION = "2.1.2" unless defined? LolDba::VERSION
3
3
  end
@@ -19,6 +19,7 @@ describe "Collect indexes based on associations:" do
19
19
 
20
20
  it "find indexes for belongs_to" do
21
21
  expect(@relationship_indexes["addresses"]).to include("country_id")
22
+ expect(@relationship_indexes["favourites"]).to include("user_id")
22
23
  end
23
24
 
24
25
  it "find indexes for polymorphic belongs_to" do
@@ -80,8 +81,7 @@ describe "Collect indexes based on associations:" do
80
81
  expect(@relationship_indexes["companies_freelancers"]).not_to include(["freelancer_id", "company_id"])
81
82
  end
82
83
 
83
- it "HABTM with polymorphic relationship" do
84
- expect(@relationship_indexes["favourites"]).to include("user_id")
84
+ it "create index for HABTM with polymorphic relationship" do
85
85
  expect(@relationship_indexes["favourites"]).to include(["favourable_id", "favourable_type"])
86
86
  expect(@relationship_indexes["favourites"]).not_to include(["project_id", "user_id"])
87
87
  expect(@relationship_indexes["favourites"]).not_to include(["project_id", "worker_user_id"])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lol_dba
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Plentz
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-10-09 00:00:00.000000000 Z
15
+ date: 2017-04-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activerecord
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.5.1
157
+ rubygems_version: 2.6.11
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: A small package of rake tasks to track down missing database indexes and