Skip to content

Commit 2defaa7

Browse files
committed
refactor: remove debugging? utility
1 parent d135b25 commit 2defaa7

File tree

3 files changed

+0
-17
lines changed

3 files changed

+0
-17
lines changed

lib/active_record/connection_adapters/cockroachdb/schema_statements.rb

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,6 @@ def schema_names
112112
super - ["crdb_internal"]
113113
end
114114

115-
def add_index(table_name, column_name, **options)
116-
super
117-
rescue ActiveRecord::StatementInvalid => error
118-
if debugging? && error.cause.class == PG::FeatureNotSupported
119-
warn "#{error}\n\nThis error will be ignored and the index will not be created.\n\n"
120-
else
121-
raise error
122-
end
123-
end
124-
125115
# ActiveRecord allows for tables to exist without primary keys.
126116
# Databases like PostgreSQL support this behavior, but CockroachDB does
127117
# not. If a table is created without a primary key, CockroachDB will add

lib/active_record/connection_adapters/cockroachdb_adapter.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,10 +145,6 @@ def srs_database_columns
145145
}
146146
end
147147

148-
def debugging?
149-
!!ENV["DEBUG_COCKROACHDB_ADAPTER"]
150-
end
151-
152148
def max_transaction_retries
153149
@max_transaction_retries ||= @config.fetch(:max_transaction_retries, 3)
154150
end

test/cases/helper_cockroachdb.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ module ExcludeMessage
1212
# some rails specific messages are then ignored.
1313
Minitest::Test.make_my_diffs_pretty! if ENV['VERBOSE']
1414

15-
# Turn on debugging for the test environment
16-
ENV['DEBUG_COCKROACHDB_ADAPTER'] = "1"
17-
1815
# Override the load_schema_helper for the
1916
# two ENV variables COCKROACH_LOAD_FROM_TEMPLATE
2017
# and COCKROACH_SKIP_LOAD_SCHEMA that can

0 commit comments

Comments
 (0)