rails/rails — Issue #5052: Re-add options to drop_table fo
Author: matthuhiggins
Created: 2012-02-15 19:34:27+00:00
State: open

In Rails 3.0 and Rails 3.1, the method signature for drop_table was
``` ruby
drop_table(table_name, options = {})
```

In Rails 3.2, it changed to
``` ruby
drop_table(table_name)
```

The options hash is used by foreigner to determine whether disable_referential_integrity should be called:
https://github.com/matthuhiggins/foreigner/blob/master/lib/foreigner/connection_adapters/sql2003.rb#L8

On Rails 3.2, no options are passed, so :force is always false. This ultimately prevents "rake db:schema:load" from working on databases with foreign_keys, which means running "rake test" also breaks.

I created a sample app that causes this problem at https://github.com/matthuhiggins/broken_foreign_keys. Run the following to reproduce:
```
bundle && rake db:setup && rake db:schema:load
```