Add CASCADE to DROP TABLE when option :force is set #56

wants to merge 1 commit into


None yet
2 participants

This is my attempt at fixing issue #53, where DROP TABLE needs a CASCADE due to the foreign key constraint. It seems to work - rake db:setup now succeeds instead of erring out that "other objects depend on it" - but it's my first time monkeying about with ActiveRecord, so I'd appreciate if you took a peek before merging.


matthuhiggins commented Jun 4, 2011

The "options = {}" part of drop_table is removed in Rails master, so I took your code and made it always add cascade without considering the options.



matthuhiggins commented Jun 5, 2011

See a88d49a

Cool! I wasn't sure if it would be OK to do the CASCADE when force wasn't set (though I can't think of why it should do cause any problems), so I was just being conservative. You actually know SQL, which gives you a leg up on these things ☺ Thanks for the quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment