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 +4 -4
- data/lib/db_schema/reader/postgres.rb +2 -5
- data/lib/db_schema/reader/postgres/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bfa8aff3899ac99623896f153f58e320732d0470aa4938f0d6486f0934da865
|
4
|
+
data.tar.gz: d4163acc967bd9f08952e2eb75d80ee2d50245094eb5f6908c35d298772877f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
238
|
-
|
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],
|
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:
|
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-
|
11
|
+
date: 2019-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sequel
|