index_shotgun 1.0.2 → 2.0.0

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
  SHA256:
3
- metadata.gz: 1a2170564fedea98e55841bdf9c3c775e9d17f82829cd0a4f4e6e373152187ff
4
- data.tar.gz: bd302f0a23894d679d67e0e32379f6a2a0631a69af57a5e5ae0ac2c04ad39edd
3
+ metadata.gz: c478302e50cc543624c0fc3c8dd1d97b4c6baf6beca5ea9ddadb1a7d01d2f758
4
+ data.tar.gz: 7e2e320e790201a5989de7152fd22e34d5d7752ca6518930ed1d3ca97bd01320
5
5
  SHA512:
6
- metadata.gz: ee13a990a519dee3c290e94782924c6d1a9eed815ebc7444867c82855e6e7600ae3ab844b882ce1149f6264ba6b122dadd5e9153e8c84dbe5dd761ddff7c9a12
7
- data.tar.gz: d49b22e234b7b96d20b559872a43780359ae81241465871bd6a8205d58aeaa215c36097d28357fadfed5cbae19e40c887e3e9bd5207d717638a74bad5d5ae1a9
6
+ metadata.gz: c62ebe57d4484a06f20e20e615d3709a15f415b2cca4425229ebd62f98cf2d2ca7191794ea8766b0b5bb3217700ee6bbf958ef8a9b96cd08b66de2dc71aecd04
7
+ data.tar.gz: 5e27c96ce0440d081c73ac3fd0ec52a65ee56012f163c8beb6faccbe85e2954e25a250a595a6e4d6edc7fad7f79d69025a0ec6ae5cd6989592e12aa8d8e7f037
@@ -44,7 +44,7 @@ jobs:
44
44
  - run: bundle exec yard
45
45
 
46
46
  - name: Setup Pages
47
- uses: actions/configure-pages@v4
47
+ uses: actions/configure-pages@v5
48
48
  - name: Upload artifact
49
49
  uses: actions/upload-pages-artifact@v3
50
50
  with:
@@ -55,12 +55,9 @@ jobs:
55
55
  uses: actions/deploy-pages@main
56
56
 
57
57
  - name: Slack Notification (not success)
58
- uses: lazy-actions/slatify@master
58
+ uses: act10ns/slack@v2
59
59
  if: "! success()"
60
60
  continue-on-error: true
61
61
  with:
62
- job_name: "*pages*"
63
- type: ${{ job.status }}
64
- icon_emoji: ":octocat:"
65
- url: ${{ secrets.SLACK_WEBHOOK }}
66
- token: ${{ secrets.GITHUB_TOKEN }}
62
+ status: ${{ job.status }}
63
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
@@ -25,7 +25,6 @@ jobs:
25
25
 
26
26
  matrix:
27
27
  ruby:
28
- - "2.4"
29
28
  - "2.5"
30
29
  - "2.6"
31
30
  - "2.7"
@@ -34,9 +33,6 @@ jobs:
34
33
  - "3.2"
35
34
  - "3.3"
36
35
  gemfile:
37
- - activerecord_5_0
38
- - activerecord_5_1
39
- - activerecord_5_2
40
36
  - activerecord_6_0
41
37
  - activerecord_6_1
42
38
  - activerecord_7_0
@@ -48,8 +44,6 @@ jobs:
48
44
  - oracle
49
45
  exclude:
50
46
  # Rails 7.0+ requires Ruby 2.7+
51
- - ruby: "2.4"
52
- gemfile: activerecord_7_0
53
47
  - ruby: "2.5"
54
48
  gemfile: activerecord_7_0
55
49
  - ruby: "2.6"
@@ -61,38 +55,6 @@ jobs:
61
55
  - ruby: "2.6"
62
56
  gemfile: activerecord_7_1
63
57
 
64
- # Rails 6.0+ requires Ruby 2.5+
65
- - ruby: "2.4"
66
- gemfile: activerecord_6_0
67
- - ruby: "2.4"
68
- gemfile: activerecord_6_1
69
-
70
- # Rails 5.x doesn't works on Ruby 3.0+
71
- - ruby: "3.0"
72
- gemfile: activerecord_5_0
73
- - ruby: "3.0"
74
- gemfile: activerecord_5_1
75
- - ruby: "3.0"
76
- gemfile: activerecord_5_2
77
- - ruby: "3.1"
78
- gemfile: activerecord_5_0
79
- - ruby: "3.1"
80
- gemfile: activerecord_5_1
81
- - ruby: "3.1"
82
- gemfile: activerecord_5_2
83
- - ruby: "3.2"
84
- gemfile: activerecord_5_0
85
- - ruby: "3.2"
86
- gemfile: activerecord_5_1
87
- - ruby: "3.2"
88
- gemfile: activerecord_5_2
89
- - ruby: "3.3"
90
- gemfile: activerecord_5_0
91
- - ruby: "3.3"
92
- gemfile: activerecord_5_1
93
- - ruby: "3.3"
94
- gemfile: activerecord_5_2
95
-
96
58
  # TODO: latest activerecord-oracle_enhanced-adapter doesn't support activerecord 7.1
97
59
  - database: oracle
98
60
  gemfile: activerecord_7_1
@@ -138,7 +100,7 @@ jobs:
138
100
  ruby-version: ${{ matrix.ruby }}
139
101
 
140
102
  - name: Cache vendor/bundle
141
- uses: actions/cache@v3
103
+ uses: actions/cache@v4
142
104
  id: cache_gem
143
105
  with:
144
106
  path: vendor/bundle
@@ -180,21 +142,19 @@ jobs:
180
142
  continue-on-error: true
181
143
 
182
144
  - name: Slack Notification (not success)
183
- uses: lazy-actions/slatify@master
145
+ uses: act10ns/slack@v2
184
146
  if: "! success()"
185
147
  continue-on-error: true
186
148
  with:
187
- job_name: ${{ format('*build* ({0}, {1}, {2})', matrix.ruby, matrix.gemfile, matrix.database) }}
188
- type: ${{ job.status }}
189
- icon_emoji: ":octocat:"
190
- url: ${{ secrets.SLACK_WEBHOOK }}
191
- token: ${{ secrets.GITHUB_TOKEN }}
149
+ status: ${{ job.status }}
150
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
151
+ matrix: ${{ toJson(matrix) }}
192
152
 
193
153
  rubocop:
194
154
  runs-on: ubuntu-latest
195
155
 
196
156
  env:
197
- RUBY_VERSION: 2.4
157
+ RUBY_VERSION: 2.5
198
158
  BUNDLE_WITHOUT: mysql postgresql sqlite3 oracle
199
159
 
200
160
  steps:
@@ -205,7 +165,7 @@ jobs:
205
165
  ruby-version: ${{ env.RUBY_VERSION }}
206
166
 
207
167
  - name: Cache vendor/bundle
208
- uses: actions/cache@v3
168
+ uses: actions/cache@v4
209
169
  id: cache_gem_rubocop
210
170
  with:
211
171
  path: vendor/bundle
@@ -224,15 +184,12 @@ jobs:
224
184
  bundle exec rubocop
225
185
 
226
186
  - name: Slack Notification (not success)
227
- uses: lazy-actions/slatify@master
187
+ uses: act10ns/slack@v2
228
188
  if: "! success()"
229
189
  continue-on-error: true
230
190
  with:
231
- job_name: '*rubocop*'
232
- type: ${{ job.status }}
233
- icon_emoji: ":octocat:"
234
- url: ${{ secrets.SLACK_WEBHOOK }}
235
- token: ${{ secrets.GITHUB_TOKEN }}
191
+ status: ${{ job.status }}
192
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
236
193
 
237
194
  notify:
238
195
  needs:
@@ -243,12 +200,9 @@ jobs:
243
200
 
244
201
  steps:
245
202
  - name: Slack Notification (success)
246
- uses: lazy-actions/slatify@master
203
+ uses: act10ns/slack@v2
247
204
  if: always()
248
205
  continue-on-error: true
249
206
  with:
250
- job_name: '*build*'
251
- type: ${{ job.status }}
252
- icon_emoji: ":octocat:"
253
- url: ${{ secrets.SLACK_WEBHOOK }}
254
- token: ${{ secrets.GITHUB_TOKEN }}
207
+ status: ${{ job.status }}
208
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
data/.rubocop.yml CHANGED
@@ -4,14 +4,16 @@ inherit_gem:
4
4
  - "config/rspec.yml"
5
5
 
6
6
  AllCops:
7
- TargetRubyVersion: 2.4
7
+ TargetRubyVersion: 2.5
8
+ SuggestExtensions: false
9
+ NewCops: disable
8
10
 
9
- Layout/AlignHash:
11
+ Layout/HashAlignment:
10
12
  EnforcedHashRocketStyle: table
11
13
  EnforcedColonStyle: table
12
14
 
13
15
  Metrics/AbcSize:
14
- Max: 33
16
+ Max: 37
15
17
 
16
18
  Metrics/MethodLength:
17
19
  Max: 25
@@ -19,6 +21,9 @@ Metrics/MethodLength:
19
21
  RSpec/NestedGroups:
20
22
  Enabled: false
21
23
 
24
+ RSpec/RepeatedDescription:
25
+ Enabled: false
26
+
22
27
  RSpec/SharedExamples:
23
28
  Enabled: false
24
29
 
@@ -26,3 +31,6 @@ Security/Eval:
26
31
  Exclude:
27
32
  - "Gemfile"
28
33
  - "gemfiles/*.gemfile"
34
+
35
+ Style/ExplicitBlockArgument:
36
+ Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,6 +1,20 @@
1
1
  # Change Log
2
2
  ## Unreleased
3
- [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.2...master)
3
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v2.0.0...master)
4
+
5
+ ## [v2.0.0](https://github.com/sue445/index_shotgun/tree/v2.0.0) (2024/05/15)
6
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.3...v2.0.0)
7
+
8
+ * :bomb: **[BREAKING CHANGE]** Requires Ruby2.5+ and activerecord 6.0+
9
+ * https://github.com/sue445/index_shotgun/pull/141
10
+ * Upgrade to rubocop 1.28.2
11
+ * https://github.com/sue445/index_shotgun/pull/142
12
+
13
+ ## [v1.0.3](https://github.com/sue445/index_shotgun/tree/v1.0.3) (2024/05/14)
14
+ [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.2...v1.0.3)
15
+
16
+ * Fixed false positives when there are multiple unique indexes on a single table
17
+ * https://github.com/sue445/index_shotgun/pull/140
4
18
 
5
19
  ## [v1.0.2](https://github.com/sue445/index_shotgun/tree/v1.0.2) (2023/12/28)
6
20
  [Full Changelog](https://github.com/sue445/index_shotgun/compare/v1.0.1...v1.0.2)
data/Gemfile CHANGED
@@ -19,5 +19,3 @@ end
19
19
  group :sqlite3 do
20
20
  gem "sqlite3"
21
21
  end
22
-
23
- eval_gemfile "#{__dir__}/gemfiles/common.gemfile"
data/README.md CHANGED
@@ -45,7 +45,7 @@ ALTER TABLE `user_stocks` DROP INDEX `index_user_stocks_on_user_id`;
45
45
  ```
46
46
 
47
47
  ## Requirements
48
- * Ruby 2.3+
48
+ * Ruby 2.5+
49
49
  * Database you want to use (ex. MySQL, PostgreSQL or SQLite3)
50
50
 
51
51
  ## Installation
@@ -22,6 +22,4 @@ group :sqlite3 do
22
22
  gem "sqlite3", "~> 1.4"
23
23
  end
24
24
 
25
- eval_gemfile "#{__dir__}/common.gemfile"
26
-
27
25
  gemspec path: "../"
@@ -22,6 +22,4 @@ group :sqlite3 do
22
22
  gem "sqlite3", "~> 1.4"
23
23
  end
24
24
 
25
- eval_gemfile "#{__dir__}/common.gemfile"
26
-
27
25
  gemspec path: "../"
@@ -24,6 +24,4 @@ group :sqlite3 do
24
24
  gem "sqlite3", "~> 1.4"
25
25
  end
26
26
 
27
- eval_gemfile "#{__dir__}/common.gemfile"
28
-
29
27
  gemspec path: "../"
@@ -23,6 +23,4 @@ group :sqlite3 do
23
23
  gem "sqlite3", "~> 1.4"
24
24
  end
25
25
 
26
- eval_gemfile "#{__dir__}/common.gemfile"
27
-
28
26
  gemspec path: "../"
@@ -19,25 +19,25 @@ Gem::Specification.new do |spec|
19
19
  spec.metadata["documentation_uri"] = "https://sue445.github.io/index_shotgun/"
20
20
  spec.metadata["rubygems_mfa_required"] = "true"
21
21
 
22
- spec.required_ruby_version = ">= 2.4.0"
22
+ spec.required_ruby_version = ">= 2.5.0"
23
23
 
24
24
  spec.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^(test|spec|features)/}) }
25
25
  spec.bindir = "exe"
26
26
  spec.executables = spec.files.grep(%r{^exe/}) {|f| File.basename(f) }
27
27
  spec.require_paths = ["lib"]
28
28
 
29
- spec.add_dependency "activerecord", ">= 5.0.0"
29
+ spec.add_dependency "activerecord", ">= 6.0.0"
30
30
  spec.add_dependency "thor"
31
31
 
32
32
  spec.add_development_dependency "bundler"
33
33
  spec.add_development_dependency "coveralls_reborn"
34
- spec.add_development_dependency "onkcop", "0.53.0.2"
34
+ spec.add_development_dependency "onkcop", "1.0.0.0"
35
35
  spec.add_development_dependency "rake"
36
36
  spec.add_development_dependency "rake_shared_context", "0.2.2"
37
37
  spec.add_development_dependency "rspec"
38
38
  spec.add_development_dependency "rspec-its"
39
- spec.add_development_dependency "rubocop", "0.62.0"
40
- spec.add_development_dependency "rubocop_auto_corrector"
39
+ spec.add_development_dependency "rubocop", "1.28.2"
40
+ spec.add_development_dependency "rubocop_auto_corrector", "< 0.4.4" # FIXME: rubocop --autocorrect doesn't available on rubocop 1.28.2
41
41
  spec.add_development_dependency "simplecov", "< 0.18.0"
42
42
  spec.add_development_dependency "yard"
43
43
  end
@@ -78,6 +78,8 @@ module IndexShotgun
78
78
  indexes.permutation(2).each_with_object([]) do |(source_index, target_index), response|
79
79
  next unless source_index.columns.start_with?(target_index.columns)
80
80
 
81
+ next if source_index.unique && target_index.unique
82
+
81
83
  if target_index.unique
82
84
  response << {
83
85
  index: source_index,
@@ -1,3 +1,3 @@
1
1
  module IndexShotgun
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "2.0.0".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: index_shotgun
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-12-28 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 5.0.0
19
+ version: 6.0.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 5.0.0
26
+ version: 6.0.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: thor
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 0.53.0.2
75
+ version: 1.0.0.0
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 0.53.0.2
82
+ version: 1.0.0.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: rake
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -142,28 +142,28 @@ dependencies:
142
142
  requirements:
143
143
  - - '='
144
144
  - !ruby/object:Gem::Version
145
- version: 0.62.0
145
+ version: 1.28.2
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - '='
151
151
  - !ruby/object:Gem::Version
152
- version: 0.62.0
152
+ version: 1.28.2
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop_auto_corrector
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
157
+ - - "<"
158
158
  - !ruby/object:Gem::Version
159
- version: '0'
159
+ version: 0.4.4
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ">="
164
+ - - "<"
165
165
  - !ruby/object:Gem::Version
166
- version: '0'
166
+ version: 0.4.4
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -223,14 +223,10 @@ files:
223
223
  - ci/database.yml.sqlite3
224
224
  - ci/install.sh
225
225
  - exe/index_shotgun
226
- - gemfiles/activerecord_5_0.gemfile
227
- - gemfiles/activerecord_5_1.gemfile
228
- - gemfiles/activerecord_5_2.gemfile
229
226
  - gemfiles/activerecord_6_0.gemfile
230
227
  - gemfiles/activerecord_6_1.gemfile
231
228
  - gemfiles/activerecord_7_0.gemfile
232
229
  - gemfiles/activerecord_7_1.gemfile
233
- - gemfiles/common.gemfile
234
230
  - index_shotgun.gemspec
235
231
  - lib/index_shotgun.rb
236
232
  - lib/index_shotgun/analyzer.rb
@@ -257,7 +253,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
257
253
  requirements:
258
254
  - - ">="
259
255
  - !ruby/object:Gem::Version
260
- version: 2.4.0
256
+ version: 2.5.0
261
257
  required_rubygems_version: !ruby/object:Gem::Requirement
262
258
  requirements:
263
259
  - - ">="
@@ -1,26 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activerecord", "~> 5.0.7"
4
-
5
- group :postgresql do
6
- # https://github.com/rails/rails/blob/v5.0.7/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L2
7
- gem "pg", ">= 0.18", "< 2.0"
8
- end
9
-
10
- group :mysql do
11
- # https://github.com/rails/rails/blob/v5.0.7/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L4
12
- gem "mysql2", ">= 0.4.4", "< 0.6.0"
13
- end
14
-
15
- group :oracle do
16
- gem "activerecord-oracle_enhanced-adapter", "~> 1.7.11"
17
- gem "ruby-oci8"
18
- end
19
-
20
- group :sqlite3 do
21
- gem "sqlite3", "~> 1.3.6"
22
- end
23
-
24
- eval_gemfile "#{__dir__}/common.gemfile"
25
-
26
- gemspec path: "../"
@@ -1,26 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activerecord", "~> 5.1.6"
4
-
5
- group :postgresql do
6
- # https://github.com/rails/rails/blob/v5.1.6/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L2
7
- gem "pg", ">= 0.18", "< 2.0"
8
- end
9
-
10
- group :mysql do
11
- # https://github.com/rails/rails/blob/v5.1.6/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L4-L6
12
- gem "mysql2", ">= 0.4.4", "< 0.6.0"
13
- end
14
-
15
- group :oracle do
16
- gem "activerecord-oracle_enhanced-adapter", "~> 1.8.2"
17
- gem "ruby-oci8"
18
- end
19
-
20
- group :sqlite3 do
21
- gem "sqlite3", "~> 1.3.6"
22
- end
23
-
24
- eval_gemfile "#{__dir__}/common.gemfile"
25
-
26
- gemspec path: "../"
@@ -1,26 +0,0 @@
1
- source "https://rubygems.org"
2
-
3
- gem "activerecord", "~> 5.2.0"
4
-
5
- group :postgresql do
6
- # https://github.com/rails/rails/blob/v5.2.0/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb#L4
7
- gem "pg", ">= 0.18", "< 2.0"
8
- end
9
-
10
- group :mysql do
11
- # https://github.com/rails/rails/blob/v5.2.0/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb#L6
12
- gem "mysql2", ">= 0.4.4", "< 0.6.0"
13
- end
14
-
15
- group :oracle do
16
- gem "activerecord-oracle_enhanced-adapter", "~> 5.2.3"
17
- gem "ruby-oci8"
18
- end
19
-
20
- group :sqlite3 do
21
- gem "sqlite3", "~> 1.3.6"
22
- end
23
-
24
- eval_gemfile "#{__dir__}/common.gemfile"
25
-
26
- gemspec path: "../"
@@ -1,15 +0,0 @@
1
- if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.4.0")
2
- # byebug v11.1.0+ requires Ruby 2.4.0+
3
- gem "byebug", "< 11.1.0"
4
-
5
- # simplecov-html v0.12.3+ requires Ruby 2.4.0+
6
- gem "simplecov-html", "< 0.12.3"
7
-
8
- # parallel v1.20.0 requires Ruby 2.5.0+ and parallel v1.20.1+ requires Ruby 2.4.0+
9
- gem "parallel", "< 1.20.0"
10
- end
11
-
12
- if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.4.4")
13
- # zeitwerk requires Ruby 2.4.4+
14
- gem "activesupport", "< 6.0.0"
15
- end