database_consistency 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a6008fb2151b236c23471bb000bafc433347f3e688f93ccfab02dd1c33008f21
4
- data.tar.gz: dbf2cf3bedae1a4e7595be03a0c85c960d3fca7a15af902aac5d2b32d4ff5a1b
3
+ metadata.gz: 8aa53651a6fab582987c49a3667bb618bf97f9f8cc48418a6c7fc0e22457104c
4
+ data.tar.gz: 7d23f15f92702e6d4bea909a5b267265da71f331653dae27d987441596806e9d
5
5
  SHA512:
6
- metadata.gz: 6fcf39eab6149c46d1971fdbbf577494eaaf4388518ec1863672f1043f6c3fb0fe55580384752db85900f9ff94a6e6e1016d065a363c9d6e1d4dfe60014101e1
7
- data.tar.gz: 035e0959fb1adadf7027279b52a302ade943c7c6cfd122742085154f6b867247b8bbbdc7beb9398b3ad559d0c568fadc9333d0cc7aa74c819100e7434bd8f75b
6
+ metadata.gz: fe01102c680e3439282bc24e7e5d98ae2ff8a14eac30339500b912902b70f9c2069d284753cd9db768d9cb1ed0c91d31332af92082ca87f01be104e10f0cc226
7
+ data.tar.gz: 7dabf536ab2825e6eae778dc97edca36c56eba676647856e05a3c287d28248287cf7f6918f563f6e1022712822719037525faf029de4a89d551439a95c6df225
@@ -16,7 +16,7 @@ module DatabaseConsistency
16
16
  # We skip check when:
17
17
  # - index is unique
18
18
  def preconditions
19
- !index.unique
19
+ !index.unique && Helper.btree_index?(index)
20
20
  end
21
21
 
22
22
  # Table of possible statuses
@@ -48,7 +48,7 @@ module DatabaseConsistency
48
48
  def covered_by_index
49
49
  @covered_by_index ||=
50
50
  model.connection.indexes(model.table_name).find do |another_index|
51
- next if index.name == another_index.name
51
+ next if index.name == another_index.name || !Helper.btree_index?(another_index)
52
52
 
53
53
  clause_equals?(another_index) && include_index_as_prefix?(another_index)
54
54
  end
@@ -112,6 +112,11 @@ module DatabaseConsistency
112
112
  end
113
113
  end
114
114
 
115
+ def btree_index?(index)
116
+ (index.type.nil? || index.type.to_s == 'btree') &&
117
+ (index.using.nil? || index.using.to_s == 'btree')
118
+ end
119
+
115
120
  def extract_columns(str)
116
121
  str.scan(/(\w+)/).flatten
117
122
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DatabaseConsistency
4
- VERSION = '2.0.6'
4
+ VERSION = '2.0.7'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: database_consistency
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.6
4
+ version: 2.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evgeniy Demin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-25 00:00:00.000000000 Z
11
+ date: 2025-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord