aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2016-07-02 05:15:35 +0900
committerRyuta Kamizono <kamipo@gmail.com>2016-07-02 05:15:35 +0900
commitbf63bc7b41219c17e4e20f7963994bbf5a718a9f (patch)
tree752b3c405c8ed61732dced5aa0e2a99155c49875
parent0d8d64e9d09cf37ae302fed17f5cd872b4053a4f (diff)
downloadrails-bf63bc7b41219c17e4e20f7963994bbf5a718a9f.tar.gz
rails-bf63bc7b41219c17e4e20f7963994bbf5a718a9f.tar.bz2
rails-bf63bc7b41219c17e4e20f7963994bbf5a718a9f.zip
Remove `create_table_info_cache` because it not be reused
`create_table_info_cache` is used for sharing `create_table_info` both `table_options` and `foreign_keys`. But `foreign_keys` no longer uses `create_table_info_cache` by #25307. No need caching anymore.
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
index c7881a6c6c..3e77b92141 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
@@ -460,7 +460,6 @@ module ActiveRecord
# it can be helpful to provide these in a migration's +change+ method so it can be reverted.
# In that case, +options+ and the block will be used by create_table.
def drop_table(table_name, options = {})
- create_table_info_cache.delete(table_name) if create_table_info_cache.key?(table_name)
execute "DROP#{' TEMPORARY' if options[:temporary]} TABLE#{' IF EXISTS' if options[:if_exists]} #{quote_table_name(table_name)}#{' CASCADE' if options[:force] == :cascade}"
end
@@ -900,12 +899,8 @@ module ActiveRecord
end
end
- def create_table_info_cache # :nodoc:
- @create_table_info_cache ||= {}
- end
-
def create_table_info(table_name) # :nodoc:
- create_table_info_cache[table_name] ||= select_one("SHOW CREATE TABLE #{quote_table_name(table_name)}")["Create Table"]
+ select_one("SHOW CREATE TABLE #{quote_table_name(table_name)}")["Create Table"]
end
def create_table_definition(*args) # :nodoc: