aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
diff options
context:
space:
mode:
authoryui-knk <spiketeika@gmail.com>2015-09-12 23:00:57 +0900
committeryui-knk <spiketeika@gmail.com>2015-11-09 23:13:23 +0900
commit7429633b824cf8aaeea52d11876e7bd2b8d2f256 (patch)
treeaad38b660d637c8d9578955eb136337e60fb2d03 /activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
parent16214d1108c31174c94503caced3855b0f6bad95 (diff)
downloadrails-7429633b824cf8aaeea52d11876e7bd2b8d2f256.tar.gz
rails-7429633b824cf8aaeea52d11876e7bd2b8d2f256.tar.bz2
rails-7429633b824cf8aaeea52d11876e7bd2b8d2f256.zip
Deprecate `#table_exists?`, `#tables` and passing arguments to `#talbes`
Reported on #21509, how views is treated by `#tables` are differ by each adapters. To fix this different behavior, after Rails 5.0 is released, deprecate `#tables`. And `#table_exists?` would check both tables and views. To make their behavior consistent with `#tables`, after Rails 5.0 is released, deprecate `#table_exists?`.
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb')
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
index d5f8dbc8fc..5cacf6eddc 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -263,7 +263,7 @@ module ActiveRecord
yield td if block_given?
- if options[:force] && table_exists?(table_name)
+ if options[:force] && data_source_exists?(table_name)
drop_table(table_name, options)
end
@@ -1088,7 +1088,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(", ")