Skip to content

Commit 98cd7d2

Browse files
committed
fix(test): fk always valid
This fixes the test `#test_all_foreign_keys_valid_having_foreign_keys_in_multiple_schemas`.
1 parent 1f91c61 commit 98cd7d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/active_record/connection_adapters/cockroachdb/referential_integrity.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ module ActiveRecord
1111
module ConnectionAdapters
1212
module CockroachDB
1313
module ReferentialIntegrity
14+
# CockroachDB will raise a `PG::ForeignKeyViolation` when re-enabling
15+
# referential integrity (e.g: adding a foreign key with invalid data
16+
# raises).
17+
# So foreign keys should always be valid for that matter.
18+
def all_foreign_keys_valid?
19+
true
20+
end
21+
1422
def disable_referential_integrity
1523
foreign_keys = tables.map { |table| foreign_keys(table) }.flatten
1624

0 commit comments

Comments
 (0)