index_shotgun 0.1.0.beta2 → 0.1.0.beta3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/index_shotgun/analyzer.rb +25 -10
- data/lib/index_shotgun/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: efda005b97a48619e646d6ea190aba4d89722d8a
|
4
|
+
data.tar.gz: 8ada78e2d7b1a7539136b19f86fddc04507cea9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 174c177214b9d24e301b99078a88f6d4400a6a59532cd99672e8721ca44221976f7b9662bff6967b693286e6011940ace8bf54469bb76f64d36513116a61c913
|
7
|
+
data.tar.gz: b75f81cad3c703a90981c631540fc9248da42f561037284de5cc28af9f0f81c9aa87de33b7513de5a2459dd8c4ed2a1c2a593e9e53dbd6aae4dbe2f32bb29b22
|
@@ -16,18 +16,33 @@ module IndexShotgun
|
|
16
16
|
array.push(*response)
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
19
|
+
message =
|
20
|
+
duplicate_indexes.each_with_object("") do |info, message|
|
21
|
+
message << <<-EOS.strip_heredoc
|
22
|
+
# =============================
|
23
|
+
# #{info[:index].table}
|
24
|
+
# =============================
|
24
25
|
|
25
|
-
|
26
|
-
|
27
|
-
|
26
|
+
# #{info[:result]}
|
27
|
+
# To remove this duplicate index, execute:
|
28
|
+
ALTER TABLE `#{info[:index].table}` DROP INDEX `#{info[:index].name}`;
|
28
29
|
|
29
|
-
|
30
|
-
|
30
|
+
EOS
|
31
|
+
end
|
32
|
+
|
33
|
+
total_index_count = tables.map { |table| table_indexes(table).count }.sum
|
34
|
+
message << <<-EOS.strip_heredoc
|
35
|
+
# ########################################################################
|
36
|
+
# Summary of indexes
|
37
|
+
# ########################################################################
|
38
|
+
|
39
|
+
# Total Duplicate Indexes #{duplicate_indexes.count}
|
40
|
+
# Total Indexes #{total_index_count}
|
41
|
+
# Total Tables #{tables.count}
|
42
|
+
|
43
|
+
EOS
|
44
|
+
|
45
|
+
message
|
31
46
|
end
|
32
47
|
|
33
48
|
# check duplicate indexes of table
|
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: 0.1.0.
|
4
|
+
version: 0.1.0.beta3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|