aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
diff options
context:
space:
mode:
authorYves Senn <yves.senn@gmail.com>2014-12-18 10:07:23 +0100
committerYves Senn <yves.senn@gmail.com>2014-12-19 11:27:04 +0100
commitbe1e0241f012f1151d2448b10e14b8b2eda26b84 (patch)
treee3060d4868ebc476830e9939e4c275d4a2a8a0fc /activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
parent36ce0c2c821e2c9cca15e768842461f834825bf7 (diff)
downloadrails-be1e0241f012f1151d2448b10e14b8b2eda26b84.tar.gz
rails-be1e0241f012f1151d2448b10e14b8b2eda26b84.tar.bz2
rails-be1e0241f012f1151d2448b10e14b8b2eda26b84.zip
`force: :cascade` to recreate tables referenced by foreign-keys.
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.rb9
1 files changed, 7 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 fd52cdf716..b340e8334b 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
@@ -132,6 +132,7 @@ module ActiveRecord
# Make a temporary table.
# [<tt>:force</tt>]
# Set to true to drop the table before creating it.
+ # Set to +:cascade+ to drop dependent objects as well.
# Defaults to false.
# [<tt>:as</tt>]
# SQL to use to generate the table. When this option is used, the block is
@@ -361,8 +362,12 @@ module ActiveRecord
# Drops a table from the database.
#
- # Although this command ignores +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.
+ # [<tt>:force</tt>]
+ # Set to +:cascade+ to drop dependent objects as well.
+ # 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 TABLE #{quote_table_name(table_name)}"