Add an `:if_exists` option to `drop_table` #18597

Merged
merged 1 commit into from Jan 20, 2015

Conversation

Projects
None yet
3 participants
@kamipo
Member

kamipo commented Jan 19, 2015

Squashed to #16366.

Add an `:if_exists` option to `drop_table`
If set to `if_exists: true`, it generates a statement like:

    DROP TABLE IF EXISTS posts

This syntax is supported in the popular SQL servers, that is (at least)
SQLite, PostgreSQL, MySQL, Oracle and MS SQL Sever.

Closes #16366.

senny added a commit that referenced this pull request Jan 20, 2015

Merge pull request #18597 from kamipo/add-if-exists-to-drop-table
Add an `:if_exists` option to `drop_table`

@senny senny merged commit 6b2be71 into rails:master Jan 20, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
@senny

This comment has been minimized.

Show comment
Hide comment
@senny

senny Jan 20, 2015

Member

@kamipo thanks for bringing this up-to-date.

Member

senny commented Jan 20, 2015

@kamipo thanks for bringing this up-to-date.

@kamipo kamipo deleted the kamipo:add-if-exists-to-drop-table branch Jan 20, 2015

kamipo added a commit to kamipo/oracle-enhanced that referenced this pull request Jan 30, 2015

Add `:if_exists` option to `drop_table` for compatibility with other …
…adapters

`:if_exists` option introduced by rails/rails#18597.
And it is used by test case already. rails/rails@7675364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment