Skip to content

Commit 3b5ac09

Browse files
committed
fixup! fix(schema): hidden columns
1 parent ff6d369 commit 3b5ac09

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/active_record/connection_adapters/cockroachdb/schema_statements.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ def indexes(table_name) # :nodoc:
6363
valid = row[5]
6464
columns = decode_string_array(row[6]).map(&unquote)
6565
hidden_columns = decode_string_array(row[7]).map(&unquote)
66-
Debug.say decode_string_array(row[6])
6766

6867
using, expressions, include, nulls_not_distinct, where = inddef.scan(/ USING (\w+?) \((.+?)\)(?: INCLUDE \((.+?)\))?( NULLS NOT DISTINCT)?(?: WHERE (.+))?\z/m).flatten
6968

@@ -264,10 +263,11 @@ def foreign_keys(table_name)
264263
FROM pg_constraint c
265264
JOIN pg_class t1 ON c.conrelid = t1.oid
266265
JOIN pg_class t2 ON c.confrelid = t2.oid
267-
JOIN pg_namespace n ON c.connamespace = n.oid
266+
JOIN pg_namespace n1 ON t1.relnamespace = n1.oid
267+
JOIN pg_namespace n2 ON t2.relnamespace = n2.oid
268268
WHERE c.contype = 'f'
269269
AND t1.relname = #{scope[:name]}
270-
AND n.nspname = #{scope[:schema]}
270+
AND n1.nspname = #{scope[:schema]}
271271
ORDER BY c.conname
272272
SQL
273273

0 commit comments

Comments
 (0)