Skip to content

Commit bdd2eee

Browse files
committed
Merge pull request rails#25633 from kamipo/remove_create_table_info_cache
Remove `create_table_info_cache` because it not be reused
1 parent 7a9e88e commit bdd2eee

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,6 @@ def rename_table(table_name, new_name)
460460
# it can be helpful to provide these in a migration's +change+ method so it can be reverted.
461461
# In that case, +options+ and the block will be used by create_table.
462462
def drop_table(table_name, options = {})
463-
create_table_info_cache.delete(table_name) if create_table_info_cache.key?(table_name)
464463
execute "DROP#{' TEMPORARY' if options[:temporary]} TABLE#{' IF EXISTS' if options[:if_exists]} #{quote_table_name(table_name)}#{' CASCADE' if options[:force] == :cascade}"
465464
end
466465

@@ -892,12 +891,8 @@ def extract_foreign_key_action(specifier) # :nodoc:
892891
end
893892
end
894893

895-
def create_table_info_cache # :nodoc:
896-
@create_table_info_cache ||= {}
897-
end
898-
899894
def create_table_info(table_name) # :nodoc:
900-
create_table_info_cache[table_name] ||= select_one("SHOW CREATE TABLE #{quote_table_name(table_name)}")["Create Table"]
895+
select_one("SHOW CREATE TABLE #{quote_table_name(table_name)}")["Create Table"]
901896
end
902897

903898
def create_table_definition(*args) # :nodoc:

0 commit comments

Comments
 (0)