Skip to content

Commit 7e4c2b4

Browse files
committed
fix: adapt tests post backport
1 parent d50714a commit 7e4c2b4

File tree

3 files changed

+3
-24
lines changed

3 files changed

+3
-24
lines changed

lib/active_record/connection_adapters/cockroachdb/referential_integrity.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ module ReferentialIntegrity
2929
# referential integrity (e.g: adding a foreign key with invalid data
3030
# raises).
3131
# So foreign keys should always be valid for that matter.
32-
def all_foreign_keys_valid?
32+
def check_all_foreign_keys_valid!
3333
true
3434
end
3535

test/cases/schema_dumper_test.rb

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,6 @@ class SchemaDumperTest < ActiveRecord::TestCase
1010
include SchemaDumpingHelper
1111
self.use_transactional_tests = false
1212

13-
# See https://github.com/cockroachdb/activerecord-cockroachdb-adapter/issues/347
14-
def test_dump_index_rather_than_unique_constraints
15-
ActiveRecord::Base.with_connection do |conn|
16-
conn.create_table :payments, force: true do |t|
17-
t.text "name"
18-
t.integer "value"
19-
t.unique_constraint ["name", "value"], name: "as_unique_constraint" # Will be ignored
20-
t.index "lower(name::STRING) ASC", name: "simple_unique", unique: true
21-
t.index "name", name: "unique_with_where", where: "name IS NOT NULL", unique: true
22-
end
23-
end
24-
25-
output = dump_table_schema("payments")
26-
27-
index_lines = output.each_line.select { _1[/simple_unique|unique_with_where|as_unique_constraint/] }
28-
assert_equal 2, index_lines.size
29-
index_lines.each do |line|
30-
assert_match(/t.index/, line)
31-
end
32-
ensure
33-
ActiveRecord::Base.with_connection { _1.drop_table :payments, if_exists: true }
34-
end
35-
3613
def test_schema_dump_with_timestamptz_datetime_format
3714
migration, original, $stdout = nil, $stdout, StringIO.new
3815

test/excludes/ActiveRecord/ConnectionAdapters/PostgreSQLAdapterTest.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,5 @@
3131
exclude :test_warnings_behaviour_can_be_customized_with_a_proc, plpgsql_needed
3232
exclude :test_allowlist_of_warnings_to_ignore, plpgsql_needed
3333
exclude :test_allowlist_of_warning_codes_to_ignore, plpgsql_needed
34+
35+
exclude :test_translate_no_connection_exception_to_not_established, "CockroachDB does not support pg_terminate_backend()."

0 commit comments

Comments
 (0)