Fix deprecations in opclasses initializer
The use of `table_exists?` in the opclasses support initializer triggers a deprecation warning. Using `data_source_exists?` removes this deprecation.
This commit is contained in:
parent
40ad7d5d7a
commit
25ea6fdd5e
|
@ -81,7 +81,7 @@ module ActiveRecord
|
|||
if index_name.length > max_index_length
|
||||
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{max_index_length} characters"
|
||||
end
|
||||
if table_exists?(table_name) && index_name_exists?(table_name, index_name, false)
|
||||
if data_source_exists?(table_name) && index_name_exists?(table_name, index_name, false)
|
||||
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' already exists"
|
||||
end
|
||||
index_columns = quoted_columns_for_index(column_names, options).join(", ")
|
||||
|
|
Loading…
Reference in New Issue