From a956ec964078ee533644fae2a99e68eda0a7c9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 6 Apr 2015 17:38:53 -0300 Subject: No need to document drop_table in the PostgreSQLAdapter It behaves in the same way that the abstract adapter. [ci skip] --- .../connection_adapters/abstract/schema_statements.rb | 3 +++ .../connection_adapters/abstract_mysql_adapter.rb | 4 ++++ .../connection_adapters/postgresql/schema_statements.rb | 10 +--------- 3 files changed, 8 insertions(+), 9 deletions(-) (limited to 'activerecord') 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 c1b4c936be..ab1b098e53 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -377,6 +377,9 @@ module ActiveRecord # [:force] # Set to +:cascade+ to drop dependent objects as well. # Defaults to false. + # [:if_exists] + # Set to +true+ to only drop the table if it exists. + # Defaults to false. # # Although this command ignores most +options+ and the block if one is given, # it can be helpful to provide these in a migration's +change+ method so it can be reverted. 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 e3385d6e6d..22c9076086 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -573,6 +573,10 @@ module ActiveRecord # [:temporary] # Set to +true+ to drop temporary table. # Defaults to false. + # + # Although this command ignores most +options+ and the block if one is given, + # 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 = {}) execute "DROP#{' TEMPORARY' if options[:temporary]} TABLE#{' IF EXISTS' if options[:if_exists]} #{quote_table_name(table_name)}#{' CASCADE' if options[:force] == :cascade}" end diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb index 44781125ae..168180cfd3 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb @@ -87,15 +87,7 @@ module ActiveRecord SQL end - # Drops a table from the database. - # - # [:force] - # Set to +:cascade+ to drop dependent objects as well. - # Defaults to false. - # [:if_exists] - # Set to +true+ to only drop the table if it exists. - # Defaults to false. - def drop_table(table_name, options = {}) + def drop_table(table_name, options = {}) # :nodoc: execute "DROP TABLE#{' IF EXISTS' if options[:if_exists]} #{quote_table_name(table_name)}#{' CASCADE' if options[:force] == :cascade}" end -- cgit v1.2.3