neetob 0.5.3 → 0.5.5

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: 3a85d5458f350de550c9785efcea262e3ac2e02eabd62488b966bb991eb25fa8
4
- data.tar.gz: 253aa491e34bba66d77c88648b616fed62ee3772094844337897a69caa3de3df
3
+ metadata.gz: 2e9f4f9a2ee60826478456769b0ec2e13822cefde51c5169281a30d1dceea6f4
4
+ data.tar.gz: 9266e85257bede98e0591aa16be29ca957728f6a83171645f99361a69066667d
5
5
  SHA512:
6
- metadata.gz: 9ac09ea5934d46982738d8e7b33d0fce4f9109da1d7ee4fb8bd7753504332ae9da13ee2f8764ae9e866e7e693cc6d4adc66d25b7b97106b84ddff780efb93f03
7
- data.tar.gz: 274107fc81d32548355a2b3b9dc3cf38bbdc2372696be9502d24760a0c2f9a56678ad6b9fed3844f9e5b12c441fd111968d8f346dbdd79d32a6b9cb9669da679
6
+ metadata.gz: 32214fd0f0ae2e81b4163a71f3a73e84402e76bb98fdbeb3be19d3ec415c62dc3a9ef792f2ddcecd0c67016fb262725814ba9419d487e7a56788068dd659f427
7
+ data.tar.gz: c78d355e36cefdb274ccd8b5820299c4a188343f10af7bf03c54c357bd1f4bfa70a1290135c80137f3d51392b8d2a9d35c4906f7840a2689506d2e085914b3da
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- neetob (0.5.3)
4
+ neetob (0.5.5)
5
5
  brakeman (~> 5.0)
6
6
  chronic
7
7
  dotenv (~> 2.8.1)
@@ -364,7 +364,7 @@ GEM
364
364
  io-console (~> 0.5)
365
365
  request_store (1.7.0)
366
366
  rack (>= 1.4)
367
- rexml (3.3.2)
367
+ rexml (3.3.3)
368
368
  strscan
369
369
  rinku (2.0.6)
370
370
  rubocop (1.39.0)
@@ -26,6 +26,7 @@ module Neetob
26
26
  has_found_tables_without_uuid = true
27
27
  print_app_and_tables(app, tables_without_uuid)
28
28
  end
29
+ verify_unique_email_index(db_schema)
29
30
  rescue Octokit::NotFound
30
31
  ui.error("There is no \"db/schema.rb\" file in the \"#{app}\" app.")
31
32
  rescue StandardError => e
@@ -44,6 +45,30 @@ module Neetob
44
45
  end
45
46
  end
46
47
 
48
+ def verify_unique_email_index(db_schema)
49
+ index_pattern = /
50
+ create_table\s+"users".*?
51
+ (
52
+ t\.index\s+\[
53
+ \s*"email"\s*
54
+ \],\s+
55
+ name:\s*"index_users_on_email"
56
+ |
57
+ t\.index\s+\[
58
+ \s*"email"\s*,\s*"organization_id"\s*
59
+ \],\s+
60
+ name:\s*"index_users_on_email_and_organization_id"\s*,\s+
61
+ unique:\s*true
62
+ )
63
+ /mx
64
+
65
+ if db_schema.match(index_pattern)
66
+ ui.success("\nUsers are indexed properly")
67
+ else
68
+ ui.error("\nUsers are not indexed")
69
+ end
70
+ end
71
+
47
72
  def print_app_and_tables(app, tables)
48
73
  ui.info("\n#{app}:-")
49
74
  tables.each do |table|
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Neetob
4
- VERSION = "0.5.3"
4
+ VERSION = "0.5.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Udai Gupta
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-08 00:00:00.000000000 Z
11
+ date: 2024-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor