db_schema-reader-postgres 0.2 → 0.2.1

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: ac61a75c190d67d10108dabc85d2a5a00d3b68d1b526bffce9289f935b4b7ae2
4
- data.tar.gz: 16ed5a257c8616376e70a26a08e4fe4363eb52ab434fbfb54830e7f0e1c90ed5
3
+ metadata.gz: 3bfa8aff3899ac99623896f153f58e320732d0470aa4938f0d6486f0934da865
4
+ data.tar.gz: d4163acc967bd9f08952e2eb75d80ee2d50245094eb5f6908c35d298772877f5
5
5
  SHA512:
6
- metadata.gz: 303ecbbaeaa32280e860543a956c3484fb70839c534fbdc0d01d39b4b5d5d854d494e6f3b4cbe6c42ad1eb5cbc6d97528ffdf21bd950fb4ab21015d0e34e4e1e
7
- data.tar.gz: f425fbd13467d54a0f98719b3339826243e1a2ead4517f5bd2d4c171b22aaba4d0c87bed68c191872303a3d1084ab2c5227dbfea25ce1d5e92d8439620ce49b2
6
+ metadata.gz: 0c6a33496c688375260630ff52787e355967b6ee586aab0671a8ea2890d2b9cdd75a24cb337a1e7a9ab7b6ac2f16efbcb5b63947ba705fb70d76d21931b9ba51
7
+ data.tar.gz: 85588548407a66c12348acce40dc70f0450303a8390f956f4fa75a72e4e3c2081f5cb6a05d3097dc1cc30fa44534dc25edd02be0cf672715397e4ad5cc5be187
@@ -234,11 +234,8 @@ SELECT extname
234
234
  get_field_name(constraint[:referenced], position)
235
235
  end
236
236
 
237
- pkey_columns = indexes_data.fetch(constraint[:referenced]).find do |index|
238
- index[:primary]
239
- end.fetch(:columns)
240
-
241
- keys = [] if keys == pkey_columns # this foreign key references a primary key
237
+ pkey = indexes_data.fetch(constraint[:referenced]).find { |index| index[:primary] }
238
+ keys = [] if !pkey.nil? && keys == pkey.fetch(:columns) # this foreign key references a primary key
242
239
 
243
240
  foreign_keys[constraint[:table_name]] << {
244
241
  name: constraint[:name],
@@ -1,7 +1,7 @@
1
1
  module DbSchema
2
2
  module Reader
3
3
  class Postgres
4
- VERSION = '0.2'
4
+ VERSION = '0.2.1'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_schema-reader-postgres
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.2'
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vsevolod Romashov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-13 00:00:00.000000000 Z
11
+ date: 2019-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel