diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-01-30 12:15:32 -0500 |
---|---|---|
committer | Rafael França <rafaelmfranca@gmail.com> | 2016-01-30 12:15:32 -0500 |
commit | 7d18de3bb57fc2f2e392cc424bbaf13d49870caf (patch) | |
tree | e14cacf22f220c31a63ad832bcec6fe635d63d53 | |
parent | 92dcda5ca391d597fd93838bef58822299a785ae (diff) | |
parent | 4e551d05c9ddfc13812d8c8d87f277d1aac371c4 (diff) | |
download | rails-7d18de3bb57fc2f2e392cc424bbaf13d49870caf.tar.gz rails-7d18de3bb57fc2f2e392cc424bbaf13d49870caf.tar.bz2 rails-7d18de3bb57fc2f2e392cc424bbaf13d49870caf.zip |
Merge pull request #23350 from kamipo/refactor_schema_migration_drop_table
Make `SchemaMigration.drop_table` to one SQL
-rw-r--r-- | activerecord/lib/active_record/schema_migration.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/schema_migration.rb b/activerecord/lib/active_record/schema_migration.rb index ee4c71f304..8f0ab2b55b 100644 --- a/activerecord/lib/active_record/schema_migration.rb +++ b/activerecord/lib/active_record/schema_migration.rb @@ -37,10 +37,7 @@ module ActiveRecord end def drop_table - if table_exists? - connection.remove_index table_name, name: index_name - connection.drop_table(table_name) - end + connection.drop_table table_name, if_exists: true end def normalize_migration_number(number) |