neetob 0.5.4 → 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: 84f2c0a766f038f35243787ae5cf6643b6b0600d2a2bfa2768144d754e1cfef0
4
- data.tar.gz: 39506d3badc8dac4d2d140beb24afaaa73bd7dabae892b51359586eb3ca61a12
3
+ metadata.gz: 2e9f4f9a2ee60826478456769b0ec2e13822cefde51c5169281a30d1dceea6f4
4
+ data.tar.gz: 9266e85257bede98e0591aa16be29ca957728f6a83171645f99361a69066667d
5
5
  SHA512:
6
- metadata.gz: a8bd670ab6fefcbc5c179d2c25f506c65a2e6c4e667e406c0f550ab0498fab4fce40481fda6229fc2d810c0d36e5fd8eb47c791c0931ff0a192a97646c91ddfb
7
- data.tar.gz: 4e8cf18b5299fb9bdc809cf0358621fbdfac865fc5871757f3dccfae00d022dc978ecf35953862606a9db82f82d28c9cda8657c33442dcbab151eba5a39f2ebc
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.4)
4
+ neetob (0.5.5)
5
5
  brakeman (~> 5.0)
6
6
  chronic
7
7
  dotenv (~> 2.8.1)
@@ -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.4"
4
+ VERSION = "0.5.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neetob
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Udai Gupta