rails/rails — pull request #16376 by skanev (2014-08-02 22:15:00+00:00)
Title: Add an :if_not_exists option to create_table

Adds an `:if_not_exists` option to `create_table` that makes it do nothing if the table already exists. I'm not sure whether it is useful, but it was mentioned in #16366 and I wanted to give a shot at implementing it.

I'm not sure about the test – I tried mimicking those in the same file (although I used `connection` instead of `Person.connection`). There might be an opportunity for a deeper refactoring of `schema_statements.rb` that I'd love to attempt if somebody gives me a few pointers (hopefully in another pull request). Either way, suggestions are welcome.

/cc @jeremy