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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dde594c3b25b6a71c75480f9a772d5fec8576cc
4
- data.tar.gz: 801a79976c58e88b62adef5b782fb51147f19fc5
3
+ metadata.gz: efda005b97a48619e646d6ea190aba4d89722d8a
4
+ data.tar.gz: 8ada78e2d7b1a7539136b19f86fddc04507cea9e
5
5
  SHA512:
6
- metadata.gz: 39ef469a2fc17f9eb275b369807d3b98d6d9280f0b0a7979d1c7eab7c54b1791f9fd32cf2b2565f5e3a27101cfa463a4559900e44bfa9fcb12d493e239ecaf4e
7
- data.tar.gz: e40a69bdf284acc3bac8ca72e13113a72a87aac8920467645807c8236536e3241d5d08d258c007d1d7965309b0e4a9a299770d5d8d83096b3564995367611842
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
- duplicate_indexes.each_with_object("") do |info, message|
20
- message << <<-EOS.strip_heredoc
21
- # =============================
22
- # #{info[:index].table}
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
- # #{info[:result]}
26
- # To remove this duplicate index, execute:
27
- ALTER TABLE `#{info[:index].table}` DROP INDEX `#{info[:index].name}`;
26
+ # #{info[:result]}
27
+ # To remove this duplicate index, execute:
28
+ ALTER TABLE `#{info[:index].table}` DROP INDEX `#{info[:index].name}`;
28
29
 
29
- EOS
30
- end
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
@@ -1,3 +1,3 @@
1
1
  module IndexShotgun
2
- VERSION = "0.1.0.beta2"
2
+ VERSION = "0.1.0.beta3"
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: 0.1.0.beta2
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-16 00:00:00.000000000 Z
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord