database_consistency 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/database_consistency/checkers/index_checkers/redundant_index_checker.rb +2 -0
- data/lib/database_consistency/checkers/index_checkers/redundant_unique_index_checker.rb +3 -1
- data/lib/database_consistency/checkers/model_checkers/model_checker.rb +1 -1
- data/lib/database_consistency/version.rb +1 -1
- data/lib/database_consistency/writers/autofix/redundant_index.rb +2 -1
- data/lib/database_consistency/writers/autofix/templates/redundant_index.tt +1 -1
- data/lib/database_consistency/writers/simple_writer.rb +10 -5
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 00b035e08de638007e2b5c13042544597dcdf30a4ea55b1a97dd4e55e16e7a1a
|
4
|
+
data.tar.gz: 9c6db1c345e64d271680c0e6effa6c84d72e2a6d4bde388a123f8ca109d157c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b322ecb69172489a441031d971c5fcdea5e68d6ed6a31486dfe36cbab349f4ffb184970f35b1cf55585398b281b82db0916fb956bc276534f42907f62ae6e32
|
7
|
+
data.tar.gz: 22e56221e6711045aaeecedfc305914d8363817c19d376d4a46e89eb3e7d17ad379213e7e07a080ee2f8734679688e9b3d8690f16f5d5097809fae466072472f
|
@@ -7,6 +7,7 @@ module DatabaseConsistency
|
|
7
7
|
Report = ReportBuilder.define(
|
8
8
|
DatabaseConsistency::Report,
|
9
9
|
:covered_index_name,
|
10
|
+
:table_name,
|
10
11
|
:index_name
|
11
12
|
)
|
12
13
|
|
@@ -39,6 +40,7 @@ module DatabaseConsistency
|
|
39
40
|
error_message: nil,
|
40
41
|
covered_index_name: covered_by_index&.name,
|
41
42
|
index_name: index.name,
|
43
|
+
table_name: model.table_name,
|
42
44
|
**report_attributes
|
43
45
|
)
|
44
46
|
end
|
@@ -7,7 +7,8 @@ module DatabaseConsistency
|
|
7
7
|
Report = ReportBuilder.define(
|
8
8
|
DatabaseConsistency::Report,
|
9
9
|
:index_name,
|
10
|
-
:covered_index_name
|
10
|
+
:covered_index_name,
|
11
|
+
:table_name
|
11
12
|
)
|
12
13
|
|
13
14
|
private
|
@@ -39,6 +40,7 @@ module DatabaseConsistency
|
|
39
40
|
error_message: nil,
|
40
41
|
index_name: index.name,
|
41
42
|
covered_index_name: covered_by_index&.name,
|
43
|
+
table_name: model.table_name,
|
42
44
|
**report_attributes
|
43
45
|
)
|
44
46
|
end
|
@@ -28,11 +28,16 @@ module DatabaseConsistency
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def writer(report)
|
31
|
-
klass =
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
31
|
+
klass =
|
32
|
+
if report.error_slug
|
33
|
+
begin
|
34
|
+
"DatabaseConsistency::Writers::Simple::#{report.error_slug.to_s.classify}".constantize
|
35
|
+
rescue NameError
|
36
|
+
Simple::DefaultMessage
|
37
|
+
end
|
38
|
+
else
|
39
|
+
Simple::DefaultMessage
|
40
|
+
end
|
36
41
|
|
37
42
|
klass.new(report, config: config)
|
38
43
|
end
|