From 4e551d05c9ddfc13812d8c8d87f277d1aac371c4 Mon Sep 17 00:00:00 2001 From: Ryuta Kamizono Date: Sat, 30 Jan 2016 20:52:33 +0900 Subject: Make `SchemaMigration.drop_table` to one SQL `SchemaMigration.drop_table` is only used in tests. Simply we can use `drop_table if_exists: true`. --- activerecord/lib/active_record/schema_migration.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'activerecord/lib/active_record/schema_migration.rb') 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) -- cgit v1.2.3