diff options
author | Guillermo Iguaran <guilleiguaran@gmail.com> | 2017-02-20 13:56:21 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-20 13:56:21 +0900 |
commit | 084ddba6837a6799fc3ee79fd48e09695b16d469 (patch) | |
tree | cb61a26e058e3ef58fc56e09e9662be1501ee472 | |
parent | e4088b70023ceebca2948c2c3d270d4279e8e657 (diff) | |
parent | 48cfb003b717c5494fb2f4d3eb10c1b339f9f05e (diff) | |
download | rails-084ddba6837a6799fc3ee79fd48e09695b16d469.tar.gz rails-084ddba6837a6799fc3ee79fd48e09695b16d469.tar.bz2 rails-084ddba6837a6799fc3ee79fd48e09695b16d469.zip |
Merge pull request #28070 from kamipo/improve_create_table_force_true
Improve `create_table force: true`
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 |
1 files changed, 2 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 bdcdfe4982..3686ad8b54 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -273,8 +273,8 @@ module ActiveRecord yield td if block_given? - if options[:force] && data_source_exists?(table_name) - drop_table(table_name, options) + if options[:force] + drop_table(table_name, **options, if_exists: true) end result = execute schema_creation.accept td |